Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kishorj1982
Creator II
Creator II

cumulative sum in pivot table showing wrong results.

Hi all,

i have performed cumulative sume for three columns and added three columns for addition.

But after pivoting the table it is showing wrong results.

Please suggest.

thanks

1 Solution

Accepted Solutions
sunny_talwar

Try this expression

if(Dimensionality()=0,$(vInvTurnsCalc)/$(vDivide),(((((rangesum(Before(RangeSum(sum(ThirdPartySales),sum(WODistribution),sum(SalesOrder))  ,0,ColumnNo(Total))))

/

If(Divide ='12', $(vBasePrice), $(vBasePrice)+Sum(InventoryValue_USD)))

/

$(vDivide))

/2)*-1))

Pivoted dimensions are unable to use Above or Below and RowNo() functions. In order to make them work, you can use Before or After and ColumnNo() function.

View solution in original post

2 Replies
pradosh_thakur
Master II
Master II

can you please elaborate ? what do you want to see and what is wrong ?

Learning never stops.
sunny_talwar

Try this expression

if(Dimensionality()=0,$(vInvTurnsCalc)/$(vDivide),(((((rangesum(Before(RangeSum(sum(ThirdPartySales),sum(WODistribution),sum(SalesOrder))  ,0,ColumnNo(Total))))

/

If(Divide ='12', $(vBasePrice), $(vBasePrice)+Sum(InventoryValue_USD)))

/

$(vDivide))

/2)*-1))

Pivoted dimensions are unable to use Above or Below and RowNo() functions. In order to make them work, you can use Before or After and ColumnNo() function.