4 Replies Latest reply: Feb 19, 2013 9:36 AM by ERICH SHIINO 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
      santoshmunipally

      Hi ,

       

      Actually i am using an EDX trigger, and i am passing a string array from the API to the Qlikview EditScript where i want to use the string array.

      For Example i have the string array as below :

       

      Arr[0] = 1;

      Arr[1]=123;

       

      and i pass the array as say "Arr".

       

      I want to access the above Arr in my edit script. When i just use Arr, i am able to acess the first value i.e 1, but i am not sure of how to use the 123 value in the list.

       

      Regards,

      Santosh Kumari

  • Re: String Array in Edit Script
    ERICH SHIINO

    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