Jump to content

I would like to combine three signals in a running condition startvalue previous signal


Go to solution Solved by John Cox,

Recommended Posts

Hey guys,

I would like to have the totalized (runningsum) of the total amount of packed product per day.

I have only the bag counter and type of bag signals. 

What I did so far: 

I created a formula to display the number of bags per type per day and fill the gaps with 0. 

$a = $pvvl2.runningDelta()
$b = $_25k

$c = $b.intersect($day)

$a.runningSum($c).replaceNotValid(0)

Now, I would like to combine those three signals; however, I don't want to go to zero every time that the bag change. I would like to have a running sum per day. 

I already tried splice, runningsum, runningdelta, but it is not working. Do you have any idea how I can get it? 

Thank you for your support. 

Formula.png

Picture2.png

Link to comment
Share on other sites

  • Seeq Team
  • Solution

Hello,

This is the approach I suggest:

1. Create a new formula for "Weight of Bag Being Packed" using your existing 25kg, 50lb, and 46 lb conditions. I converted 25kg to lbs as the "default weight" but you can do this however is best, and use kg or lbs as desired (I used lbs):

// Default to 25 kg and substitute in other weights when those conditions are present

(55.12).splice(50,$FiftyLbCondition).splice(46,$FortySixLbCondition)

2. Calculate "Amount Packed" with a new formula, using the result from step 1:

// use .max(0) in case the bag counter ever resets

($BagCounterSignal.runningDelta().max(0))*$WeightBagBeingPacked

3. Calculate the "Daily Running Sum of Amount Packaged" with a new formula, using a daily condition and the result from step 2:

$AmountPacked.runningSum($DailyCondition)

Link to comment
Share on other sites

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