Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

String Array in Edit Script

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

5 Replies
Not applicable
Author

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.

erichshiino
Partner - Master
Partner - Master

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

Not applicable
Author

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

erichshiino
Partner - Master
Partner - Master

Hi,

Instead of an array, can you concatenate the values in a single value and use Eduardo's approach?

Regards,

Erich

arieidel
Partner - Creator II
Partner - Creator II

Hello Erich,

Just to tell you that I was also looking for a "String Array in Edit Script" and your suggestion was exactly what I needed.

Thanks.
Ariel