Search the Community
Showing results for tags 'if statements'.
-
We often do calculations where we are interested in having one result if one condition is true and a second result if another condition is true. In this post we will discuss how to do this calculation in Seeq. We will create a new single signal which runs different calculations during different periods of time. This technique can be used to replicate "if" logic or "if / else" logic currently being used in excel. Example existing code from excel or other systems IF Temperature > 90 then show a result of (Temperature * 100) IF Temperature < 90F then show a result of (Temperature + 10) Step 1: Identify two modes of operation In the Tools tab identify the following conditions using the Value Search tool: Step 2: Use formula to reconstruct "if/then statement" using Seeq's Splice Tool Local Variables: Name Item Type $Temperature Temperature Signal $HighTempCondition Greater than 90 Condition Seeq Formula: $HighTempCalc = $Temperature * 100 $LowTempCalc = $Temperature + 10 $LowTempCalc.splice($HighTempCalc,$HighTempCondition) Section 1 - $HighTempCalc This is a local variable which is to be run during periods of high temperature Section 2 - $LowTempCalc This is a local variable which is to be run when NOT in periods of high temperature Final - $LowTempCalc.splice($HighTempCalc,$HighTempCondition) Combine your two series. Use the LowTempCalc series, unless you are in the High Temperature condition, in which case use the HighTempCalc Content Verified DEC2023
- 2 replies
-
- 2
-
- formula
- value search
-
(and 1 more)
Tagged with:
-
Hi lots, Is there a functionality of "If...then...else" statements in formulars. Or is there at least a workaround? Thanks for your answer in advance!
- 7 replies
-
- boolean logic
- if statements
-
(and 4 more)
Tagged with:
-
Hi All, I'm trying to perform Multiple IF Statement in seeq but don't have any clarity as to how should i perform. Can anyone tell me how should i apply it. I have gone through the Below links as well which are already available in seeq forum,it seems they're not helping either. Link :- Regards, Jitesh Vachheta
-
A common analytics need is to create a signal with numerical values that are based on an existing condition. Users often want to translate a condition (on/off, good data/bad data, running/down, etc.) to a numerical value to be used in calculations. For example, a user may want to multiply a process signal by a 0/1 value based on when the process is down/running. This technique can also be used to replicate "if" logic or "if / else" logic, where different values are returned depending on if the condition is true/false. Converting a condition to a signal value can be easily accomplished in Seeq using the Formula Tool and the splice function. Here is an example where we convert a condition to a signal of 0s and 1s: 1. Use the Value Search Tool to create a HOT condition for time periods when the Temperature signal is > 90 degrees F: 2. Use the Formula Tool to convert the HOT condition to a 1 (when condition is true) and a 0 (when condition is false): 3. View the results in the trend. The new signal in lane 2 has a value of 1 when the HOT condition is true. Otherwise, the signal is 0. Additional Information Using Conditions and the Splice Function to Replace If Statements Content Verified DEC2023