Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
9917mark
Contributor III
Contributor III

Generate a sequence number from 1 to 7

 

Evening,

I have  a requirement to allocate a sequence number to my data from 1 to 7.

This must then repeat from 1 to 7 until the table has finished loading.

Table consists of a list of SKU's totaling 87000 

The Idea is to use the sequence number to filter the data for easier analysis.

And then export each sequence number to an excel spreadsheet for import.

Sample Raw Data:

sku
1000000
1000001
1000003
1000004
1000005
1000006
1000007
1000008
1000009
1000010
1000011
1000012
1000014
1000015
1000016

 

Desired Result:

sku Seq
1000000 1
1000001 2
1000003 3
1000004 4
1000005 5
1000006 6
1000007 7
1000008 1
1000009 2
1000010 3
1000011 4
1000012 5
1000014 6
1000015 7
1000016 1

 

Thank you in advance.

Labels (3)
1 Solution

Accepted Solutions
MarcoWedel

LOAD sku,
     Mod(RowNo()-1,7)+1 as Seq
From YourSource

hope this helps

Marco

View solution in original post

2 Replies
MarcoWedel

LOAD sku,
     Mod(RowNo()-1,7)+1 as Seq
From YourSource

hope this helps

Marco

9917mark
Contributor III
Contributor III
Author

@MarcoWedel  Thank you for you prompt response. Works perfectly