Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Esteemed Contributor III

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

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
Honored Contributor III

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

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

];

MVP
MVP

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

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
Valued Contributor II

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

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');

Community Browser