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

Create iterative numbers

 
 

Hello,

I am trying to achieve Field2;

Field1  Field2

1            1

2            1

3            1

1            2

2            2

3            2

1           3

2           3

3           3

I tried peek function as well as loops but I couldn't success. I am trying to create page numbers for NPrinting PowerPoint so the tables will fit accordingly.

Thank you!

2 Solutions

Accepted Solutions
jyothish8807
Master II
Master II

Hi @X01330132 ,

May be like this this ?

T1:
load *,
RowNo() as SiNo,
if(Field1<>previous(previous(previous(Field1))),1,if(Field1=peek(Field1,-3),peek(Field2,-3)+1)) as Field2;
Load * Inline [
Field1
1,
2,
3,
1,
2,
3,
1,
2,
3
];

jyothish8807_0-1632392742413.png

 

 

Best Regards,
KC

View solution in original post

Saravanan_Desingh

Try this,

tab1:
Load RowNo() As RowID,*,AutoNumber(RowNo(), Field1) As Field2 Inline [
Field1
1
2
3
1
2
3
1
2
3
];

commQV02.PNG

View solution in original post

4 Replies
jyothish8807
Master II
Master II

Hi @X01330132 ,

May be like this this ?

T1:
load *,
RowNo() as SiNo,
if(Field1<>previous(previous(previous(Field1))),1,if(Field1=peek(Field1,-3),peek(Field2,-3)+1)) as Field2;
Load * Inline [
Field1
1,
2,
3,
1,
2,
3,
1,
2,
3
];

jyothish8807_0-1632392742413.png

 

 

Best Regards,
KC
X01330132
Contributor
Contributor
Author

Worked like a charm, thanks a lot 🙂

Saravanan_Desingh

Try this,

tab1:
Load RowNo() As RowID,*,AutoNumber(RowNo(), Field1) As Field2 Inline [
Field1
1
2
3
1
2
3
1
2
3
];

commQV02.PNG

X01330132
Contributor
Contributor
Author

Also works great, thank you!