Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to take the sum of two expressions being multipled against each other, but one of the expressions is a rangesum, not allowing me to do so. Please see the attached screenshot for an example look of what I am trying to do. I am also trying to avoid doing the rangesum in the load script.
I want to multiply the below two expressions against each other, then after, take the sum of it.
Expression 1: Calculates the rolling 4 wk sum of my original expression: Sum(Qty)
=Avg(Aggr(RangeSum(Above(Sum({< YYYYQ =, YYYYWK = >} Qty)
, 0, 4)), Group, YYYYWK))
Expression 2: Is just the Amt.
=Sum(Amt)
So, what I need to do is:
SUM(
Avg(Aggr(RangeSum(Above(Sum({< YYYYQ =, YYYYWK = >} Qty)
, 0, 4)), Group, YYYYWK))
*
Amt
)
I think that because in my first expression, I am already taking the rangesum of my original expression, I cannot take the sum of the whole formula again.
Note: {< YYYYQ =, YYYYWK = >} is there just to say that upon making selections on these fields, do not change values. Can be disregarded on functionality, just needs to be included in syntax.
Any help would be greatly appreciated!
Regards
Hi Steve,
This expression works perfectly:
SUM(
aggr(
Avg(Aggr(RangeSum(Above(Sum({< YYYYQ =, YYYYWK = >} Qty)
, 0, 4)), Group, YYYYWK))
*
Amt,
Group,Person,YYYYWK)
)
Thank you so much for the help on this, it really helped me out.
That's great to hear, thanks for letting me know.
Steve