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

Indicies using rowno() function

Hello Qlik-Experts,

i have a small problem:

SonPhan_0-1635503989725.png

I want to get the rowno based on two fields.

When i try to use the following code:

Aggr(RowNo(), Item, ID)

it works. But this will sort the data in load order, which is not what i want. I want to sort it by Item and Date?

The challenge here is that the backend should not be touched (scripting). 

Hopefully you can help me!

Best regards Son

3 Replies
rubenmarin

Hi, as a workaround to rowno you can use a new expression callend 'Count' and an expression like:

If(Item=Above(TOTAL Item),RangeSum(Above(TOTAL [Count]),1), 1)

SonPhan
Partner - Creator
Partner - Creator
Author

Hello Rubenmarin,

 

thank you for your answer,

 

could you explain me what exactly i should insert into the field [Count] ?

rubenmarin

Hi, Count it's not a field it's the label of the expression "If(Item=Above(TOTAL Item),RangeSum(Above(TOTAL [Count]),1), 1)"

So the expression uses the result of the same expression in the row above to accumulate 1 by 1, unless the item of the above row it's different, in that case it starts again on 1.