Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

andrewhurl
New Contributor

Looping Record ID

Good Afternoon,

First post on these forums as I look to expand the use of QLIK within our organization. We are in the process of importing some data from CSV, and need to identify each line in the order with a record number which isn't being provided from the data source.

The CSV file looks like this:

 

Order NumberSKULine Number
2220799Item 1
2220799Item 2
2220799Item 3
2220799Item 4
2220799Item 5
2220799Item 6
2220799Item 7
2220799Item 8
2220799Item 9
2221424Item 1
2221424Item 2
2221424Item 3

When the import is occurring to QLIK Sense via the data load, we need to add a an ERP Line Order Number, which identifies the SKU's line number on the Order Number. EG:

 

Order NumberSKULine Number
2220799Item 11
2220799Item 22
2220799Item33
2220799Item 44
2220799Item 55
2220799Item 66
2220799Item 77
2220799Item 88
2220799Item 99
2221424Item 11
2221424Item 22
2221424Item 33

The line number relates to the position on the order, so needs to reset each time the Order Number changes.

With other programming I would do this defining a variable within the load, but from my reading this isn't supported in QLIK.

Any assistance in how we can achieve this would be appreciated.

1 Solution

Accepted Solutions

Re: Looping Record ID

May be like this:

LOAD [Order Number],

          SKU,

          AutoNumber(RowNo(), [Order Number]) as [Line Number]

FROM .....

3 Replies

Re: Looping Record ID

May be like this:

LOAD [Order Number],

          SKU,

          AutoNumber(RowNo(), [Order Number]) as [Line Number]

FROM .....

andrewhurl
New Contributor

Re: Looping Record ID

Hi Sunny,

Thankyou for the speedy reply.

Initial testing indicates this seems to be working! I will do some more detailed testing and revert back.

Thankyou once again

rupamjyotidas
Valued Contributor

Re: Looping Record ID