Seeq Team Lindsey.Wilcox Posted November 20, 2020 Seeq Team Posted November 20, 2020 Background As a starting point, I have a signal that indicates the process error code (Error) and 2 signals that indicate the current container (Container 1 and Container 2). I would like to create a histogram that summarizes which containers have the most frequent errors. More specifically, I want to know: For the Container 1 signal, what is the distribution of container values when the error code is equal to 44 and 47 For the Container 2 signal, what is the distribution of the container values when the error code is equal to 45 I want the results summarized as a single histogram. The following steps describe how this can be achieved using conditions and capsule properties. Solution 1. Create a condition with a capsule for each value change in the Error signal. This can be accomplished in Formula using the following syntax $errorSignal.toCondition() Note: the .toCondition() operator assigns a Value property to each capsule that indicates the value of the Error signal during the capsule. This property can be used for aggregation in a Histogram. 2. Filter the condition created in Step 1 to only include capsules with errors of interest for the Container 1 signal. This can be accomplished in Formula, using the following syntax: //Create intermediate conditions for each error $error1=$errorCond.keep('value',isEqualTo('44')) $error2=$errorCond.keep('value',isEqualTo('47’)) //Combine the 2 intermediate conditions $error1.combineWith($error2) 3. Assign a ‘Container’ capsule property to each of the capsules in the Error Cond 1 condition that indicates the value of the Container 1 signal. This can be accomplished within Formula, using the following syntax: $errorCond1.removeLongerThan(1week).transform($capsule -> $capsule.setProperty('can', $container1.average($capsule))) 4. Repeat Steps 2&3 for Container 2 a. Filter the condition created in Step 1 to only include capsules with errors of interest for Container 2. This can be accomplished in Formula, using the following syntax: $errorCond.keep('value',isEqualTo('45')) b. Assign a ‘container’ capsule property to each of the capsules in the Error Cond 2 condition that indicates the value of the Container 2 signal. This can be accomplished within Formula, using the following syntax: $errorCond2.removeLongerThan(1week).transform($capsule -> $capsule.setProperty('container', $container2.average($capsule))) 5. Combine the error conditions with container property to create a single, composite condition. This can be performed in the Composite Condition tool. 6. Finally, create the histogram based upon this composite condition.
Seeq Team Lindsey.Wilcox Posted December 14, 2021 Author Seeq Team Posted December 14, 2021 Since posting this solution, the Formula provided in Step 4B has been simplified to: $errorCond2.removeLongerThan(1week).setProperty('container', $container2, startValue())
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