Jump to content

Histogram to Summarize Multiple Signals


Recommended Posts

  • Seeq Team

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).

image.png

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()

image.png

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)

image.png

 

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)))

image.png

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'))

image.png

     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)))

image.png

 

5. Combine the error conditions with container property to create a single, composite condition.  This can be performed in the Composite Condition tool.

image.png

6. Finally, create the histogram based upon this composite condition.

image.png

 

Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...