11 Replies Latest reply: Jan 22, 2018 4:25 AM by RAVI SHINGE RSS

    Create For loop for 36 Months

    RAVI SHINGE

      Hello Guys,

       

      Could you please let me know how do I create a

      For loop for 36 months .

       

      Thanks,

      Ravi

        • Re: Create For loop for 36 Months
          Petter Skjolden

          In a load script you can create a FOR loop like this:

           

          FOR month=1 TO 36

             LOAD

                  AddMonths(MakeDate(2018,1,1),month-1) AS Month;

                  ......

             AUTOGENERATE 1;

          NEXT

           

          In a visualization you can use the ValueLoop()-function to generate within an expression:

           

          AddMonths(MakeDate(2018,1,1), ValueLoop(0,35))     // to be used for instance in a calculated dimension.

          • Re: Create For loop for 36 Months
            RAVI SHINGE

            Thanks for replying Petter ,

            FOR month=1 TO 36

            I have to use column name like Duration. How do I use this column DURATION instead of 1 to 36 . ?

            DURATION column has value of 36 . So I want For loop starting from 1st month to 36th month.

             

            So  I need something  as mentioned below .

             

            FOR x=1 to "DURATION"


             

            Thanks,

            Ravi