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

Rangesum complex (?) issue

Hi,

I have created a table containing a limited number of columns.

Sort order is important in that table :

1 : weight

2 : order (useful in case of equality of weight)

The Qlikview  document herejoined contains the table with a few date, and a screenshot detailing what is the expected result.

I have tried several ways to do it, without success. It probably needs to use rangesum function but I don't know how to specifiy the dimensions on which the rangesum should be applicated.

Thank you for your help !

12 Replies
sunny_talwar

Something like this:

Capture.PNG

varunreddy
Creator III
Creator III

Sunny,

rangesum(below(sum(weight),1,Rowno()))

In this expression, you specified 1. does the sum start from current row. what if we specify 0 and what rowno() doing?

We have 10 , 8, 0. How are we getting 0?

Regards,

Varun

swuehl
MVP
MVP

Or maybe

=aggr( rangesum(below(sum(WEIGHT),1,NoOfRows())), AGENT,  ORDER)

allowing you to resort the straight table, with the drawback that the ORDER field needs load order like requested sort order (which is the case in your sample qvw).

oxiofrt
Partner - Creator
Partner - Creator
Author

Thank you very much Sunny, we are close to the solution.

There's something I miss : why doesn't it work anymore as soon as I add the WEIGHT column within the table ? (all rangesum values are turning to zero)

Didn't succeed to solve it...

Qlik.png

Thanks

sunny_talwar

Add WEIGHT and ORDER as expressions rather than dimension in your chart and see if that works.

Capture.PNG

oxiofrt
Partner - Creator
Partner - Creator
Author

Well, I had simplified the table, not imaginating that dimensions could be a problem.

You will find herejoined the table with the dimension I would like to display in that table, including an additional variable which is used in a test.

Adding that dimensions is causing the problem. !

sunny_talwar

Have you looked at swuehl‌ response? I have not checked it, but I have a feeling that his might not be affected by adding another dimension.

oxiofrt
Partner - Creator
Partner - Creator
Author

Yes I did the the sorting issue is a real drawback.

I hoped to manage to avoid it 🙂

sunny_talwar

Adding the dimension will be problematic because if you add dimensions you will need to use Aggr function and Aggr function will sort based on the sort order even if I tell it to no do that. I think you have two options

1) Go by Stefan's method and sort in the script

2) Use all your other dimensions as expressions

If I were you, I will spend some extra time getting it done through method 1.