Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Highlighted
Not applicable

Re: Variables in script + user input box

I would now like to use the variable (vDate3) and load it during the load script in a table (whilst still being able to update via input box), creating a formula similar to this:

Number - $(vDate3) as Number2;

Although am having issues - have attached a doc for "clarity?"

Kind regards, Rich

let vDate1 = 0;
Set vDate2 = 5;
Set vDate3= '=vDate1 + vDate2';  // << updates when user makes selection in input box

TempData:
Load *,
Number - '=(vDate3)' as Number2  // <<- how to update to have live value taken from interface/input box as per above
resident Data;
drop table Data;

13 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Variables in script + user input box

Try this:

let vDate1 = 0;

Set vDate2 = 5;

Let vDate3= rangesum($(vDate1),$(vDate2));  // << updates when user makes selection in input box

TempData:

Load *,

Number - $(vDate3) as Number2  // <<- how to update to have live value taken from interface/input box as per above

resident Data;

drop table Data;


talk is cheap, supply exceeds demand
Highlighted
trdandamudi
Honored Contributor II

Re: Variables in script + user input box

Replace the below line:

Number - '=(vDate3)' as Number2  // <<- how to update to have live value taken from interface/input box as per above

With the below :

Number - $(vDate3) as Number2

Highlighted

Re: Variables in script + user input box

I have added a trigger instead of using the variable definition to set the value for vDate3. See if this helps.

Best,

Sunny

Highlighted
Not applicable

Re: Variables in script + user input box

Hi Sunny,

Thanks for review - unfortunately it the trigger doesn't appear to update following a new drop down selection..?

Gysbert / Thirumala

when scripted as follows, this hardcodes the result of vDate3 in the table (ignoring "future" input box selections)

Number - $(vDate3) as Number2

Any other suggestions?

Highlighted

Re: Variables in script + user input box

A new drop down selection? in vDate1?

Highlighted

Re: Variables in script + user input box

Seems to be working for me

Highlighted
Not applicable

Re: Variables in script + user input box

Hi Sunny,

Thanks for your patience - using your example, when reloading the doc - all is well...

When the value in the input box (vDate1) is adjusted, the "Number2" in table (in red) appears to remain as before / per the reload

Is this the case for you?

Highlighted

Re: Variables in script + user input box

No, I see the number changing at my end.

I made some changes in the script als0:

//let vDate1 = 0;

//Set vDate2 = 5;

//Set vDate3= '=vDate1 + vDate2';  // << updates when user makes selection in input box

TempData:

Load *,

Number - $(vDate3) as Number2  // <<- how to update to have live value taken from interface/input box as per above

resident Data;

drop table Data;

//rename table TempData to Data;

Highlighted
Not applicable

Re: Variables in script + user input box

Hi Sunny,  I see "vDate3" updates on new selection - although "Number2" remains as is?

What can I change so I see what you see (ie ensured I saved doc to my pc etc..)?