Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ravishinge
Creator
Creator

Create For loop for 36 Months

Hello Guys,

Could you please let me know how do I create a

For loop for 36 months .

Thanks,

Ravi

11 Replies
ravishinge
Creator
Creator
Author

Thanks Petter,

[DurationFlow3]:

Load

"Impact month",  // has value of 12

"Duration" // has value of 4

FROM [lib://AttachedFiles/Complexity_Mix.xlsx]

(ooxml, embedded labels, header is 1 lines, table is Model);

Let vImpact_Month=Peek('Impact month',0,DurationFlow3);

For i=1 to 36

    

     For x=1 to 4    // here I want ( For x= 1 to Duration)  from table  [DurationFlow3]:    Rest all code is fine for me , Just need this for loop ...

     if $(i) =1 then

         test:

          load

          $(i) as Month,

          $(x) as Month2,

          $(vImpact_Month) as value

          AutoGenerate 1;

   

     ELSE

      test:

          load

          $(i) as Month,

          $(x)+($(i)-1) as Month2,

            $(vImpact_Month) as value

          AutoGenerate 1;

     ENDIF

    

     NEXT x;

NEXT i;

ravishinge
Creator
Creator
Author

Thanks Petter ,

I was able to Solve the issue . I did something like this  and it worked for me .....Thanks a lot for the support , I appreciate your suggestions

let vDuration= Peek('Duration',0,Duration_table);

for x=1 to $(vDuration)