# Calculated Batch Limit applied as a Scalar

## Recommended Posts

• Seeq Team

Background:

I want to calculate a limit for my process based on the average of my historical batches. I have calculated the average of each batch using signal from condition, but now I want to take the average of my last several historical batch averages and apply the result to future batches as a scalar in Seeq.

Solution: 2) Add a custom condition for the historical range that you want to use for your calculation: 3) Using signal from condition, calculate the average of the averages over that historical range: 4) Convert the resulting value to a scalar in formula:

Formula is - \$avg.toScalars(capsule('2019')).last()

Where \$avg is your average of averages, and the Capsule(‘2019’) just needs to contain the year where that sample is placed.

My signal from condition for Average of Averages placed the sample at the start of my historical range condition, so in this formula, I put the year in which my historical range capsule started, 2019. 5) Resulting view of the data outside of the historical range: • 2