JWu Posted March 8, 2022 Share Posted March 8, 2022 I have only 6 capsules under a condition. Without importing CSV file, could I set a property for capsules by giving different numbers? Thanks! Link to comment Share on other sites More sharing options...
Super Seeqer Shamus Cunningham Posted March 9, 2022 Super Seeqer Share Posted March 9, 2022 I am sure that there are probably a few ways to do this but here is a solution I came up with $conditionToSamples = $condition.aggregate(count(),$condition,durationkey()) $countingRange = condition(capsule('2020-01-01T00:00Z', '2023-01-01T00:00Z')) $countSignal = $ConditionToSamples.runningsum($countingRange) $condition.setProperty('Capsule Count',$countSignal,average()) Step by Step Outline $conditiontoSamples - Take your input condition and turn it into a signal with a value of 1 whenever the condition exists $countingRange - the range we are going to count these capsules over. In this example beginning of 2020 to beginning of 2023 $countSignal - Create a signal that counts up those values for each condition starting at the start date Set the value of the $countSignal as a property on your original condition Link to comment Share on other sites More sharing options...
Seeq Team Joe Reckamp Posted March 9, 2022 Seeq Team Share Posted March 9, 2022 Depending on whether you want the numbers to be 1-6 or just a unique identifier, another common approach is to use the timestamp of the start of the capsules. In this case, you could do something like: $condition.setproperty('ID', $condition.tosignal('start').tostring(), startvalue()) Link to comment Share on other sites More sharing options...
JWu Posted March 9, 2022 Author Share Posted March 9, 2022 Thanks, Shamus and Joe! How about any numbers which are not coming from signals, let's say 23, 14.5, -3, 0, 65, 4, could we set those numbers as properties of the capsules? Link to comment Share on other sites More sharing options...
Seeq Team Joe Reckamp Posted March 9, 2022 Seeq Team Share Posted March 9, 2022 Hi JWu, The easiest way would be to use the Manual Signal tool (https://support.seeq.com/space/KB/1795391628/Manual+Signal) to create a new signal where the values line up with when the capsules are present and then setting that as a property on the capsules. Link to comment Share on other sites More sharing options...
JWu Posted March 9, 2022 Author Share Posted March 9, 2022 Thanks, Joe! This is indeed what I want. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now