Jump to content

Recommended Posts

Posted

Dear.... 

I have a Question.... I have a continues batch process, marked by an UNIQUE Batch ID (Bleu stepped line) and I need to perform calculation per Batch ID. 

How would I do that.... 

Calculation: tot rejects per batch, per signal

 

!!!..... but.... look closely.(SEE SECOND image...)... the batch step is triggered at the start of the filling process.... and some of the reject counter may still be working on the previous batch.... 

 

TIPS and TRICKS are welcom.... 

image.thumb.png.57ae94b18e3fd534f736fb825f8472e9.png

image.png.ee785d659cf1ead71b893a895c20405d.png

Posted

Hi Robin,

you may try the following way. I tried to set up an environment, that represents your data. In the first step I created a condition for each batch:

image.thumb.png.a43a1d5c5311773e957b462d9dd2ce39.png

As you can see the "Counter" signal is increasing after the end of the batch. Next I created capsules for the periods between every counter reset using formula. For each capsule the maximum value is stored as a property:

($counter.runningDelta() < 0).afterStart(0s).inverse().removeLongerThan(1wk).transform($c -> $c.setproperty('CounterValue', $counter.maxValue($c)))

image.thumb.png.13a4c90436c712f8b3a3fbf2409939c5.png

In the last step I used another formula to transfer the countervalue to a signal that is displayed across the duration of the batch:

$batch.removeLongerThan(1wk).tosamples($capsule ->
{
    $max = $capsulesForCounter.toGroup($capsule).last().property('CounterValue')
    sample($capsule.startKey(), $max)
}, 1d).tostep(1wk)

image.thumb.png.8723f9f6ad36b12258c7d131398b5775.png

 Will this work for you?

Regards,

Thorsten

Posted

thanks ! will give it a try.... but there is a complication... (isn't it always... ;))

there is sometimes a reset within the batchstep..... 

image.thumb.png.6dad45e49639b558514ba511be1bdf67.pngt

 

Posted

Hi Robin,

as I understood you want to have the sum of the values at ~ 9 am and  ~ 3 pm as the value for the batch 22091 NR.

Therefore I changed the last formula of my previous post:

$batch.removeLongerThan(1wk).tosamples($capsule ->
{
    $maxFirst = $capsulesForCounter.toGroup($capsule).first().property('CounterValue')
    $sumOfMax = $capsulesForCounter.toGroup($capsule).reduce(0, ($r, $x) -> $r + $x.property('CounterValue'))
    sample($capsule.startKey(), $sumOfMax-$maxFirst)
}, 1d).tostep(1wk)

image.thumb.png.7661151d6fdf110fa2354632b913ea2b.png

 

Regards,

Thorsten

  • Like 1
Posted

getting close.. 😉

impressed.... can we have a short call (webex or team) so I can explain hands on.... I work in GMT+1 timezone... 

  • 1 year later...
  • Seeq Team
Posted

Another approach that may be a bit simpler than the reduce function to solve the same problem would be to first take the maximum of each section of the increasing counter tag and place it at the start of the counting, which should assign it in time to the correct batch. This can be done with the following formula:

$counter.aggregate(maxvalue(), ($counter == 0).growend(30d), startkey())

After that, you can then simply sum up the individual sections for each batch:

$signal.aggregate(sum(), $batch, durationkey())

 

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