Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Tal564
Contributor II
Contributor II

add a cumulative percent column of total sales

Hi 

I am trying to add a cumulative percent column of total sales  in a straight table: 

here's an example : 

Customer       sales     %sales         Cumulative %sales

a                         200        40%               40%
b                         150        30%               70%
....

Deos anyone know what's the formula for the last column?

Many Thanks

Tal

1 Solution

Accepted Solutions
Tal564
Contributor II
Contributor II
Author

Ok so this one works for me but it  still disarrays my order :

rangesum(Above(total sum(TotalNetSalePrice), 0, rowno(Total))) / sum(total TotalNetSalePrice)

So in ordr to maintain the sorting, you need to sort by expression the dimension you want.

In this case customer (a,b...)

Thanks

View solution in original post

3 Replies
jochem_zw
Employee
Employee

Try this:

rangesum(above(sum(sales),0,rowno()))/sum(total sales)

 

Tal564
Contributor II
Contributor II
Author

Doesn't work 😞  plus it disarrays the previous sorted column

Tal564
Contributor II
Contributor II
Author

Ok so this one works for me but it  still disarrays my order :

rangesum(Above(total sum(TotalNetSalePrice), 0, rowno(Total))) / sum(total TotalNetSalePrice)

So in ordr to maintain the sorting, you need to sort by expression the dimension you want.

In this case customer (a,b...)

Thanks