Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adimiz123
New Contributor III

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
Tags (1)
3 Replies

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

May be like this

LOAD [order id],

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

FROM ...

adimiz123
New Contributor III

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

thanks,

But the loading a takes a very long time

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

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

Community Browser