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

How to hold more than one values (Table Vlaues) into a variable in LOAD Script?

Hi Guys,

Is that possible to hold more than one value into a single variable?

LET vNow=Now();

LOAD_ON_REQUES_CONFIG:

LOAD * INLINE [

    RunDateTime, NumberOfMonths, LoadFlag

    $(vNow), 12, 0

    $(vNow), 18, 0

    $(vNow), 24, 0

];

Now I want to hold 12, 18, 24 (these 3 values) into a single variable vNumberOfMonths. Is that possible?

4 Replies
vishsaggi
Champion III
Champion III

Hi Kumar,

Please check if this would suffice your requirement....leaving trigger option.

Set trigger to select multiple values in a field from a variable

Thanks,
Vish.

anbu1984
Master III
Master III

LET vNow=Now();

LET vNumberOfMonths='12;18;24';

LOAD_ON_REQUES_CONFIG:

LOAD *,Evaluate(NumberOfMonths) INLINE [

    RunDateTime, NumberOfMonths, LoadFlag

    $(vNow), "Subfield('$(vNumberOfMonths)',';',1)", 0

    $(vNow), "Subfield('$(vNumberOfMonths)',';',2)", 0

    $(vNow), "Subfield('$(vNumberOfMonths)',';',3)", 0

];

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I do not fully understand your requirement, but this will make your script sample work:

LOAD_ON_REQUES_CONFIG:

LOAD Now() As RunDateTime,*

INLINE [

     NumberOfMonths, LoadFlag

    12, 0

    18, 0

    24, 0

];

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
danieloberbilli
Specialist II
Specialist II

A variable can only store one value at a time (but can be overwritten anytime). You can store multiple values in a variable by concatenating single values...but I doubt that this will help you.

I guess it would look similar to this:

LET vTest =  peek('NumberOfMonths',0,'LOAD_ON_REQUES_CONFIG') &', '& peek('NumberOfMonths',-1,'LOAD_ON_REQUES_CONFIG') &', '& peek('NumberOfMonths',-2,'LOAD_ON_REQUES_CONFIG');