# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for
Did you mean: Anonymous
Not applicable

## csum + order by + contribution

Good afternoon!

I need to get the contribution, and then the total amount. But before that, sort the measure (with the contribution) in descending order. All this I want to do for three measures in one dimension.

For example:

[OPS_SALES]:

Category, Opsum1, Opsum2, Opsum3

'A', 150, 300, 58

'B', 100, 250, 30

'C', 200, 208, 88

'D', 153, 400, 65

];

column 1 (first measure):

Sum(Opsum1)

column 2 (contribution):

Sum(Opsum1) / Sum(Total Opsum1)

column 3 (rank for order by):

Rank(Sum(Opsum1)/Sum(total Opsum1))

column 4 (Cumulative with order by) uncorrectly:

RangeSum(above((

Sum(Opsum1)/Sum(total Opsum1)

), 0, Rank(Sum(Opsum1)/Sum(total Opsum1)) ))

For last column i want get to example from excel screenshot.

I can not use the sorting of dimension in the measure, since I want to get a cumulative sum of three measures(opsum1, opsum2, opsum3)

Thank you!

1 Solution

Accepted Solutions Anonymous
Not applicable
Author

I could do it with help stalwar1

"
Try this
Aggr(RangeSum(Above(Sum(Opsum1), 0, RowNo())), (Category, (=Sum(Opsum1), Desc))) /Sum(TOTAL Opsum1)

I used the idea described here:

Recipe for a Pareto Analysis – Revisited

"

3 Replies  Partner - Master

Hi,

May be as at attached file?

Regards,

Andrey Anonymous
Not applicable
Author

I could do it with help stalwar1

"
Try this
Aggr(RangeSum(Above(Sum(Opsum1), 0, RowNo())), (Category, (=Sum(Opsum1), Desc))) /Sum(TOTAL Opsum1)

I used the idea described here:

Recipe for a Pareto Analysis – Revisited

" Anonymous
Not applicable
Author

No, the task was not to paint. 