Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
dzmitry_shmurye
Partner - Creator
Partner - Creator

RowNo() alternative

Hi community!

I am trying to create expression for generate Row numbers in the straight table but without using RowNo() function.

I have tryed to write expression like this:

RangeSum(1,Above(Rows))

But I need generate Rows values only for first fives rows in the table (P1 - P5) and for others rows it's should be Null values in the Rows expression.

Could somebody help me resolve this issue?

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi Dzmitry,

For load order you have to set a RowNo or RecNo on script, if your order will set by a value, then use this value.

For load order:

     Ascendent: IF(Rank(Total Min(-Num(PositionLoad)))<=5,Rank(Total Min(-Num(PositionLoad))))

     Descendent: IF(Rank(Total Min(Num(PositionLoad)))<=5,Rank(Total Min(Num(PositionLoad))))

For calculated value:

     Ascendet: IF(Rank(Total Sum(-Value))<=5,Rank(Total Sum(-Value)))

     Descencet: IF(Rank(Total Sum(Value))<=5,Rank(Total Sum(Value)))

Regards.

View solution in original post

22 Replies
Not applicable

Hi,

Will P1 always be 1, P2 always 2 etc or could that change?

dzmitry_shmurye
Partner - Creator
Partner - Creator
Author

No, I can select P3-P8 and P3 should have 1, P4 -2 etc like RowNo() function.

Anonymous
Not applicable

Hi Dzmitry,

Try this:

IF(Rank(Total Min(-Num(Purgechar(Product,'P'))))<=5,Rank(Total Min(-Num(Purgechar(Product,'P')))))

Regards

sujeetsingh
Master III
Master III

I do not know r you facing an issue or you doing an R&D  to find another way of doing it.

Digvijay_Singh

try this -

If(rowno()<=5,rangesum(Above([Rows]),1),'-')

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Not the most elegant hack, but it works. This one uses a dummy hidden expression (RowActive)

RowNo() alternative thread219933.jpg

Best,

Peter

tamilarasu
Champion
Champion

Or you can try below expression,

If(Isnull(Above(Rows)),1,If(Above(Rows)+1<=5, Above(Rows)+1,'-'))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Nice one, faking Null values

susovan
Partner - Specialist
Partner - Specialist

It might be work.

if(RowNo()<6,RangeSum(1,Above(Rows)))

Warm Regards,
Susovan