Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

LOOP

Hello.

I need to loop until the amount of the "Plots":

My table is like this:
Projection Term Plots
10 11/01/2011 5

Need it to break through the field "PLOTS". In this case are five parcels, then he has to break in May. Ex:

Projection Term Plots
10 11/01/2011 5
10 11/01/2011 4
10 11/01/2011 3
10 11/01/2011 2
10 11/01/2011 1

7 Replies
Anonymous
Not applicable
Author

HELP...

tresesco
MVP
MVP

Hi Washington,

Could you please explain your query in another descriptive way ? i am not getting exactly what you want.

Regards,

tresesco

maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi,

I need some sample data to resolve ur issue.

Anonymous
Not applicable
Author

My table is like this:

Term Date Plots
10 11/01/2011 5

I need to make a loop to repeat the record as the number of installments.
So will this way:

Term Date Plots
10 11/01/2011 5
10 11/01/2011 4
10 11/01/2011 3
10 11/01/2011 2
10 11/01/2011 1

Needs to be done in the script.

Not applicable
Author

Hi,

Perhaps something like peek('Plots') to get the "5". The concept might be something like...

tmp:

load * inline

[

term, date, plots

10,'11/10/2011',5

];

let x = peek('plots');

let y = peek('term');

let z = peek('date');

for i = 1 to $(x)

load * inline

[

term2,date2,plots2

$(y),$(z),$(i)

];

next i



Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Use LOAD with WHILE clause - something like this (I don't totally guarantee the syntax):


LOAD
Term,
Date,
IterNo() as Plot_Number
resident
<source table name>
WHILE
IterNo() <= Plots
;


Anonymous
Not applicable
Author

Because this script just a record breaking quantities of parts?

tmp:

load

[

;

Let

Let

for

i = 1 to $(x)

load

[

;

next

i * inline z = peek('DATA'); x = peek('PARCELAS'); * inline