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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Xabinav
Creator
Creator

How to create row number that for "sun" table. like 1.1, 1.2, 2.1, 2.2

Hi,

I want to create the "order line" field like at 2. table

for each order id create  row number that group by his order id.

How can i do that.

thank's

1.

order id
1
2
3

2.

order idorder line
11.1
11.2
11.3
22.1
22.2
3 Replies
sunny_talwar

May be like this

LOAD [order id],

     [order id] & '.' & AutoNumber(RowNo(), [order id]) as [order line]

FROM ...

Xabinav
Creator
Creator
Author

thanks,

But the loading a takes a very long time

sunny_talwar

The other option is this

LOAD [order id],

      [order id] & '.' & Rank as [order line];

LOAD [order id],

     If([order id] = Previous([order id]), RangeSum(Peek('Rank'), 1), 1) as Rank

FROM ...