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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Row Numbering

 

Hello,

i have the dimension: Item / Location / Lot 

There's any way to assign the RowNo based on combination of Item/Location/Lot ? so if the combinantion of these 3 dimension change, the Row Numbering starts again from 1 ?

Thank u!

qlikviewaf_1-1657783879770.png

 

2 Replies
marcus_sommer
MVP
MVP

It could be done with interrecord-functions, for example:

load *,
if(ITEM = previous(ITEM) and
    LOCATION = previous(LOCATION) and
    LOTN = previous(LOTN),
rangesum(1, peek('RowNoFlag')), 1) as RowNoFlag
resident Source order by ITEM, LOCATION, LOTN;

Important is to load resident with an appropriate sorting. Thinkable are also autonumber() with a recno() but this is mostly quite (too) slow.

- Marcus

MarcoWedel
MVP
MVP

In case you don't have too many rows/distinct combinations of your 3 key fields, then the AutoNumber solution that Marcus already mentioned could be:

AutoNumber(RecNo(),Hash128(ITEM,LOCATION,LOTN)) as RowNo