Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jordicastilloga
Contributor II
Contributor II

Problem with LET and Concat() in the script

Hi!

I have a problem when trying to assign a value to a variable in the script.

- I have to assign a list of values of an excel to one variable. For that, I load the excel, and then I put the following statement in the script:

LET variable1 = Concat(Field1,',').

The problem is, that, later on, variable1 is assigned with 'Concat(Field1,','), instead of the content of the Field1 (eg. 11,14,15,16).

How can I fix that??  I just want to assign the string '11,14,15,16' into the variable1.

Many thanks!!

Jordi.

1 Solution

Accepted Solutions
dapostolopoylos
Creator III
Creator III

Check out the attached app.

Father/Husband/BI Developer

View solution in original post

7 Replies
neelamsaroha157
Specialist II
Specialist II

If I understand your question correctly, instead of using the values from Field1 column, you want to hard code the strig '11, 14, 15, 16'.

If the above statement is correct then may be use can use Set instead of Let - SET variable1 = '11,14,15,16'.

jordicastilloga
Contributor II
Contributor II
Author

Ni Neelam,

Thank you very much for your answer. I can't do that because the numbers will be stored in one excel and will be changed every week by the user. So I need to extract the numbers from the excel, and put it in one variable. There is any way??

Thanks!!!!!!

balabhaskarqlik

May be like this:

ABC:

LOAD * Inline

[

Field

1

1

2

3

5];

let noRows = NoOfRows('ABC')-1;

for i=0 to $(noRows)

let vVar=FieldValue('CaptureDateTime',$(i));

Temp:

LOAD * ,'$(vVar)' as Field1

Resident ABC;

next i

Drop table ABC;

thevingo
Creator
Creator

Hi

why do you want this to be done at script-level(Back end).

At the expression-level(Front end) i.e. in textbox it works fine

dapostolopoylos
Creator III
Creator III

Check out the attached app.

Father/Husband/BI Developer
jordicastilloga
Contributor II
Contributor II
Author

YEEEEEEEEEEEEEEAH!!!

Thanks Dimitrios!!!

dundigalla
Contributor
Contributor

Thank You GuruSmiley Happy