Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

 

Labels (3)
2 Replies
marcus_sommer

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

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