4 Replies Latest reply: Feb 19, 2013 9:36 AM by Erich Shino RSS

    String Array in Edit Script

    santoshmunipally

      Hi ,

       

      I want to create a string array in Edit Script of the Qlikview document and loop through the array.

       

      I tried using

       

      Let Arr[2] = {A,b};

       

      but it is throwing a syntax error. Can anyone help me on this?

       

      Thanks in Advance.

       

      Regards,

      M.Santosh Kumari

        • Re: String Array in Edit Script
          Eduardo Correa da Silva

          You can concatenate their words and by a separate identifier.

           

          Ex.:

           

          LET array = "abcd, 123, xyz";

           

          To scroll through your array, you can use functions character subfield:

           

          TEST:

               LOAD

                    Subfield ('$ (array)', ',', Rowno ()) AS STR

               AutoGenerate (3);

             

          Where ',' as the separator and definitions of your array and Rowno() refers to the position of your text to go.

          • Re: String Array in Edit Script
            Erich Shino

            Hi,

            I suggest you create your array in a table then, you can loop the rows:

            Table:

            LOAD * INLINE [

                F1

                A

                b

            ];

             

             

            let x = NoOfRows('Table'); // Get number of itens in "Array"

             

             

            //Loop Table Rows

            For i = 0 to x-1

                      let content = peek('F1',i,'Table') ;//Get the n-th item

                      Trace $(content); //It can be used! (in this case, it is just printed in the script log)

            next

             

            drop table Table; // optional

             

            Hope it helps,

             

            Regards,

            Erich