Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
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