Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
adimiz123
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 ...

adimiz123
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 ...