Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
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

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
Partner
Partner

Try this:

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

 

Tal564
Contributor II
Contributor II

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

Tal564
Contributor II
Contributor II

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