Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Accumualte just if value is positive

Hello,

i'm using this formula tu accumulate the values through the months

=Rangesum(before(sum(CapacityQty),0,ColumnNo(total)))

 

Of course this is accumulating regardless if the value of  is positive or negative

There's a way to tweak the formula to accumulate only if the value is positive ? and avoid to accumulate the negative?

Thanks!

Labels (1)
5 Replies
Kushal_Chawda

@qlikviewaf  try below

 

=Rangesum(before(if(sum(CapacityQty)>0,sum(CapacityQty),0),0,ColumnNo(total)))

or

Rangesum(before(sum({<CapacityQty={">0"}>}CapacityQty),0,ColumnNo(total)))

 

qlikviewaf
Creator
Creator
Author

Thank you!

 

What if i would like to carry over just positive values  resulting from a sum of 4 different measure ?

So not just CapacityQty, but the result of CapacityQty+Stock+Backorder-OnHand ?

is something possible?

Thank you again!!

Kushal_Chawda

@qlikviewaf  try below

=Rangesum(before(if(sum(CapacityQty)+sum(stock)+sum(backorder)>0,sum(CapacityQty)+sum(stock)+sum(backorder),0),0,ColumnNo(total)))
MarcoWedel

=RangeSum(Before(RangeMax(Sum(CapacityQty+Stock+Backorder+OnHand),0),0,ColumnNo(TOTAL)))

qlikviewaf
Creator
Creator
Author

Hi Marco,

Let me rephrase the need. 

I have Capacity  , On hand , Backorder, Need, Saeftystock quantities.

 

  1. For each period I Calculated the net need as (Capacity + On hand - Backorder - Need - SaeftyStock)
  2. The need needs to be carried over through the periods, with a maximum cap driven by Saefty Stock (so the carry over amount cannot be more than saefty stock)
  • Here below i put all the measure  (Capacity , on hand , backorder , need , saefty stock) and i summarized by Available  and Need with the difference shown as NET
  • On the Expected Carryover is what i expect to get from a formula
  • On the Carryover i set the formula suggested, but is not working as expected

Do you mind to help me in understanding what i'm missing? Thank you!

qlikviewaf_0-1684749099809.png