Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

csum + order by + contribution

Good afternoon!

I need your help!

Please please) I'm new to Qlik Sense.

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]:

LOAD * Inline [

    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

"

View solution in original post

3 Replies
ahaahaaha
Partner - Master
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.
thanks for the answer