# How to make SQC Chart in Seeq

## Recommended Posts

I am finding it difficult to create an SQC chart in Seeq

If I show this in Excel, it is pretty easy

1. I start with a Temperature that effects a Quality measurement.  The process engineer suspects there is a relationship between Temperature and Quality

2. The engineer puts a condition into Excel to show the quality good when it is greater than 80

3. We filter for all good values

4. We create the average and standard deviation for the good values

5. We put these values in columns, with a 2-standard deviation limit high and low

6. Now we can create a chart showing the quality is bad when temperature is outside limits

********

Now I want to do this in Seeq

1. I create condition for good quality

2. I use the condition to calculate the average when quality is good.  THIS IS THE PROBLEM; it calculates an average for every capsule, not for the aggregate condition.  Using aggregate in a formula doesn't work either.  I find no way to calculate the average for the whole condition

3. Using a metric has the same problem

4. I can use "within()" to create a signal that only has temperature during good quality

5. I can then use a metric to calculate the average for good condition

6. However, I cannot use it in a formula.  Therefore, the average and standard deviation from a metric cannot be used in a formula for SQC limits like I have in Excel

*********

Does anyone know how this can be done in Seeq?

##### Share on other sites

• Seeq Team

Hello Pat,

indeed step two is where you didn't find the correspondance between Excel and Seeq. The Signal from condition you did will compute an average for every high efficiency capsule. In order to compute the average on all capsules, I suggest the following steps:

1. Create a new "cleansed" temperature signal which equals to nothing outside the high quality periods and equals to temperature during those periods. This is equivalent to the filter you put on Column E. This formula should do the job: \$temperaturesignal.remove(\$highqualitycondition)
2. Create a new condition by merging the high quality capsules. This way, you will have a long period of time covering all temprature samples. This formula should do the job as well: \$highqualitycondition.merge(2d). Please replace the 2d by the maximum interval between your capsules)
3. Now you can calculate the average and standard deviation of the new created signals during the new condition. Please pay attention to maximum capsule duration field in the Signal From Condition tool

Now you are all set, you can calculate the upper and lower limits with simple Formulas and you should obtain something similar to the below screenshot:

Let me know if this works for you or not.

Thanks,

--Selmane

Edited by Selmane
Correct Orthograph
##### Share on other sites

This doesn't quite work.  As you can see, the average calculated this way differs from the Metric (Temp when good Avg Metric).  This is really clunky, even if it worked.  I am going to submit a feature request

##### Share on other sites

• Seeq Team

Hello Patrick,

In your screenshot, you are calculating the average on the Temperature Signal but I suggest you do that on "Temp when good" signal. Can you please try that and let me know if the result is correct and matches the metric output?

I agree it seems a bit complex but switching from calculations in a spreadsheet to capsules requires changing a bit the way you tackle problems.

I hope this helps,

--Selmane

##### Share on other sites

Hi Pat,

You should be able to get the average across all of your capsules with the following formula:

```//Define the time period that contains all good quality capsules
\$capsule = capsule('2023-02-25T11:36:16.491000+00:00', '2023-03-27T11:36:16.491000+00:00')

//Create average based on the good quality capsules.
\$Temp.remove(not \$Good_Quality).toDiscrete().average(\$capsule).tosignal()```

This will produce an unweighted average using toDiscrete(). Note that we define a large capsule that captures all the good quality capsules, remove the data outside of the good capsules, convert temp to discrete, take the average, and covert the average to a signal.

If you want to create a dynamic "training" period, you could do the following as well:

```//Use the last 7d of data to capture the good quality capsule data
\$capsule = capsule(now() - 7d, now())```

Please let me know if this helps get you what you are looking for.

Synjen

##### Share on other sites

This helps, but it is really clunky.  I hate having to type in specific dates in DataLab to create capsules.  What I really want is to create conditions in WorkBench that I can use in calculations in DataLab.  It looks like the best way to do that is within() in formulas.  Most of the calculations cannot use conditions, they need capsules.

##### Share on other sites

This helps, but it is really clunky.  I hate having to type in specific dates in DataLab to create capsules.  What I really want is to create conditions in WorkBench that I can use in calculations in DataLab.  It looks like the best way to do that is within() in formulas.  Most of the calculations cannot use conditions, they need capsules.

##### Share on other sites

Thanks Selmane, I made that correction and it works.  I really wish there was a cleaner way to do this.  I would like to just do calculations on conditions instead of being restricted to capsules.

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