Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Repeat values on every nth row of a column

Hi,

I want to create a column (lets name it as Sequence) which has value 1 on 1st, 6th, 11th, 16th.....and so on rows, value 2 on 2nd, 7th, 12th, 17th...and so on rows. Finally I want a sequence of 1 to 5 repeating till the end of row (see sample data attached).

Any help in this will be greatly appreciated.

2 Replies
sunny_talwar

May be this

Table:

LOAD RowNo() as RowNo,

  Mod(RowNo()-1, 5) + 1 as Sequence

AutoGenerate 20;

Capture.PNG

9917mark
Contributor III
Contributor III

@sunny_talwar  After 3 hours of searching I came across your solution. Thank you.