Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Luiper
Contributor II
Contributor II

duplicate records descendingly with While

Good morning, I want to double a row of the loaded base depending on the amount of a field by subtracting one unit until it reaches 1, the table is as follows:

LOAD REQ.,
ID,
[BT No.],
[Certificate No.],
Product,
[Number of installments]


I want a loaded line to be duplicated if the [Number of installments]>1 and subtract the number of installments 1 until this subtraction of this field reaches 1.

thank you
Labels (2)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe with iterno()


X:
load * inline [
ID, NumOf
1,1
2,2
3,3
12,2
5,5
];

Y:
load
ID, NumOf, iterno() as N
Resident X
WHILE
IterNo() <= NumOf;

DROP table X;

 

maxgro_0-1691076638059.png

 

View solution in original post

2 Replies
maxgro
MVP
MVP

maybe with iterno()


X:
load * inline [
ID, NumOf
1,1
2,2
3,3
12,2
5,5
];

Y:
load
ID, NumOf, iterno() as N
Resident X
WHILE
IterNo() <= NumOf;

DROP table X;

 

maxgro_0-1691076638059.png

 

Luiper
Contributor II
Contributor II
Author

Perfect, I applied the function and it worked for me without problems, thank you very much