robin Posted October 21, 2020 Posted October 21, 2020 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....
Thorsten Vogt Posted October 21, 2020 Posted October 21, 2020 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: 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))) 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) Will this work for you? Regards, Thorsten
robin Posted October 22, 2020 Author Posted October 22, 2020 thanks ! will give it a try.... but there is a complication... (isn't it always... ;)) there is sometimes a reset within the batchstep..... t
Thorsten Vogt Posted October 22, 2020 Posted October 22, 2020 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) Regards, Thorsten 1
robin Posted October 26, 2020 Author Posted October 26, 2020 getting close.. 😉 impressed.... can we have a short call (webex or team) so I can explain hands on.... I work in GMT+1 timezone...
Seeq Team Joe Reckamp Posted June 3, 2022 Seeq Team Posted June 3, 2022 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())
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