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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Number table row consecutively

Hi!

We would like to add a column that simply shows "1" for the first row, "2" for the 2nd row and so on.

It should always show the same numbering even when the sorting is changed.

Thanks for your help!

Best Regards

Sebastian

16 Replies
Clever_Anjos
Employee
Employee

Try rowno() as expression

swuehl
MVP
MVP

or

=rowno(total)

when using multiple dimensions.

Not applicable
Author

Hi,

unfortunatly rowno() breaks sorting completely.

Regards

Sebastian

Not applicable
Author

This one  works!

Not applicable
Author

No, it does not work. Sorting is not possible anymore, sort settings are completely ignored, when you have a column with a formula "rowno(total)". The table itself is fine though.

Not applicable
Author

Are you using rowno() in an expression? If yes then put it in the LOAD statement of the table in the QlikView script instead,

e.g.

LOAD

     Rowno() as UID,

     Field1,

     Field2,

     ...

FROM ....

Not applicable
Author

Yes, I tried to put it as an expression. Putting it into the script does not work either, the value for the row number is empty after (reloading the script and) adding it to my table.

Not applicable
Author

Sebastian Kather wrote:

...the value for the row number is empty after (reloading the script and) adding it to my table.

It should work. Try RecNo() instead of RowNo() (in the script)?

From the help guide:

Counter Functions

These functions do not have any parameters. The parentheses are however still required.

RecNo( )

Returns an integer for the number of the currently read row of the internal table. The first record is number 1.

RowNo( )

Returns an integer for the position of the current row in the resulting QlikView internal table. In contrast to RecNo( ), which counts the records in the raw data table, the RowNo( ) function does not count records that are excluded by where clauses and is not reset when a raw data table is Concatenation to another. The first row is number 1.

Examples:

Raw data tables:

Tab1.csv

A

B

1

aa

2

cc

3

ee

Tab2.csv

A

B

5

xx

4

yy

6

zz

QVTab:

Load *, RecNo( ), RowNo( ) from Tab1.csv where A<>2;

Load *, RecNo( ), RowNo( ) from Tab2.csv where A<>5;

The resulting QlikView internal table:

QVTab

A

B

RecNo( )

RowNo( )

1

aa

1

1

3

ee

3

2

4

yy

2

3

6

zz

3

4

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Show us. Post a document that demonstrates the issue. I cannot replicate the behaviour you're describing.


talk is cheap, supply exceeds demand