Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

What is wrong with my rangesum?

Hello!

Maybe someone could help me on this...

I have  a pivot table as shown below

   

PlantMaterialKeyWeek11/02/201511/16/201511/23/201512/14/201512/21/2015
HKADemand 10000-12000400026000
HKASupply 140008000-380006000

Now I want to create a cumulative formula where Supply - Demand  by using the formula  but the rangesum didn't work...it's just Supply-Demand...

=RangeSum(sum({$<key = {'Supply'}>} Qty) - sum({$<Key = {'Demand'}>} Qty)) 

  Results of my 2nd pivot table  

PlantMaterialMonWeek11/02/201511/16/201511/23/201512/14/201512/21/201512/28/201501/18/2016
HKA 40008000-1200034000-20000-14000-6000

I also tried using formula below but still did not work

RangeSum(alt(Before(TOTAL [Net Forecast]), 0), sum({$<Key = {'Supply'}>} Qty) - sum({$<key = {'Demand'}>} Qty))

My output should be like this...

   

  Expected Output...

   

PlantMaterial11/02/201511/16/201511/23/201512/14/201512/21/2015
HKA4,00012,000034,00014000

  Rgds  

 

 

3 Replies
swuehl
MVP
MVP

Try

RangeSum(Before( sum({$<Key = {'Supply'}>} Qty) - sum({$<key = {'Demand'}>} Qty),0,ColumnNo()) )

Anonymous
Not applicable
Author

hi! Swuehl,

Thank you for your quick response ...I tried the formula but this is the result ...

11/16  should be 12K...

Tks.

   

PlantMaterialWeek11/02/201511/09/201511/16/201511/23/201511/30/201512/07/201512/14/2015
HKA 400008000-120000034000
swuehl
MVP
MVP

Seems to work for me.

Please have a look at the attached sample file (or post a sample file with your data).