Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Try rowno() as expression
or
=rowno(total)
when using multiple dimensions.
Hi,
unfortunatly rowno() breaks sorting completely.
Regards
Sebastian
This one works!
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.
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 ....
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.
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:
These functions do not have any parameters. The parentheses are however still required.
Returns an integer for the number of the currently read row of the internal table. The first record is number 1.
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 |
Show us. Post a document that demonstrates the issue. I cannot replicate the behaviour you're describing.