Ario Posted July 24, 2020 Share Posted July 24, 2020 I am trying to use multiple signals and trying to sum them when another signal has value of 1. How can I create the formula? If $t1 = 1 then sum($t2*$t3+$t4*t5) I would like the sum to go to zero as soon as $t1 value changes from 1 I tried running sum but if I limit the period the last sum that is still ongoing will not be calculated. Also tried combewith() but no luck. Thanks in advance. Link to comment Share on other sites More sharing options...
Seeq Team Joe Reckamp Posted July 24, 2020 Seeq Team Share Posted July 24, 2020 (edited) Hi Ario, The Seeq version of Excel's IF function is called splice. In order to do what you would like to do, you would want to do 2 steps: 1. Create a Value Search for when $t1 = 1 2. Create a Formula that splices either a value of 0 or the sum formula depending on whether $t1 is 1 or not. The formula would look like: 0.tosignal().splice($t2*$t3+$t4*$t5,$ConditionfromStep1) This effectively says make the value 0 when a capsule for $t=1 is not present, but when a capsule becomes present, make the value of the signal the sum of $t2*$t3+$t4*$t5. Edited July 24, 2020 by Joe Reckamp 2 Link to comment Share on other sites More sharing options...
Ario Posted July 24, 2020 Author Share Posted July 24, 2020 Thank you; you aced it. Exactly what I was looking for. 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