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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

row number only where an expression is not null

hi, I am trying to get row numbers only for those rows in a pivot table where an expression is not null. For eg:
if my table has following values

value

0

0

0

1200

123

120

232

I want the row numbers in a adjacent column to be displayed as:

value     rownumber

0              

0              

0              

1200           1

123            2

120            3 

232            4

and so on.. any suggestions?

8 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Null or 0? Your question and example do not tie up.

Assuming null - when loading the table containing value:

     LOAD ...

          value,

          If(IsNull(value) = 0, 1 + Alt(Peek(RowNo), 0)) As RowNo,

          ...

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

sorry for the ambiguity in my question. It's 0 and not null and I want to implement this in the front end only, not the script.

Not applicable
Author

You check on Suppress Zero Values in the Presentation tab which would remove the dimensions that hold a 0 as a value and then use RowNo()

simenkg
Specialist
Specialist

Table:
Load

     Value,

     rowno() as RowNo

form Table.qvd (qvd)

where Value<>'0';

Concatenate(Table)
load Value

From Table.qvd (qvd)

where Value = 0;

anbu1984
Master III
Master III

Check this app

144971.png

anbu1984
Master III
Master III

If you have two dimensions, then try this

144971.png

Not applicable
Author

Hi,

Try this....

LOAD * INLINE [

    A, B

    a

    a, 0

    a, 0

    c

    c, 12

    c, 0

    d,

    e, 4

    f, 10

    g, 0

    h, 156

];

Rank(count(total A)+if(sum(B)>0,Rank(if(sum(B)>0,RowNo()))))

Regards,

Garry

Anonymous
Not applicable
Author

Hi Cheliyan,

Thanks for the answer. I get my answer from your example.

Thanks.

Best Regards,