Currently I have trouble in finding the solution for a repeater within Qlik. Using For each or For I cannot seem to get it working.
Assume the following set
Repeater:
Load * Inline [
Name,RepeatMe,Start,End
Bill,1,1,1
Maria,7,1,
Chris,4,2,5
Jennifer,6,2,
];
What I want is a repeater, that repeats the records inside the table based on the variable RepeatMe. The variable Start dictates when the repeater starts with its count, and the variable End is used to put the value at the last repeated record. If End has a null, in the case of Maria and Jennifer, there is no value in End. See image below for output. Thanks in advance!
Here you go.
Repeater:
Load
Name,
Start+IterNo()-1 as Start,
If(Start+IterNo()-1=End, End) as End
While IterNo()<=RepeatMe;
Load * Inline [
Name,RepeatMe,Start,End
Bill,1,1,1
Maria,7,1,
Chris,4,2,5
Jennifer,6,2,
];
Here you go.
Repeater:
Load
Name,
Start+IterNo()-1 as Start,
If(Start+IterNo()-1=End, End) as End
While IterNo()<=RepeatMe;
Load * Inline [
Name,RepeatMe,Start,End
Bill,1,1,1
Maria,7,1,
Chris,4,2,5
Jennifer,6,2,
];
Elegant solution! Many thanks!