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

Retrieve value of an input box

Hi,

I have an input box with the variable test. The value of this variable is =Date(Today()-1)

Then, in the script, i want to put this variable in a where clause.

Here is my problem, i tried:

Where Column <> $(test)

but it doesn't work because of the '='.

And the thing is that the '=' char is needed in the expression of the variable or it displays 'Date(Today()-1)'

Anyone have an idea for this?

Thanks,

Best Regards,

Loïc

1 Solution

Accepted Solutions
maxgro
MVP
MVP

From Menu

R Click on sheet --> New Sheet Object --> Slider/Calendar Object.....-->

In General Tab choose Calendar (Input Style) and Variable(s)

calendar variable.jpg

View solution in original post

9 Replies
Not applicable
Author

Hi Loic!
What's your requirements? will the variable be set by the user? is the value '=Date(Today()-1)' a default value?
Have you tried an If-statement ?


You can try this in your script: where column<> if($test='=Date(Today()-1)'

,Date(Today()-1),$test)

Regards

Not applicable
Author

Yes that's right, i just want '=Date(Today()-1)' to be a default value.

I don't know, how do you think i can do this with an If statement?

Gysbert_Wassenaar

Just set the variable in the script before you use it in the where clause:

LET vYesterday = num(today()-1);

Test:

Load * from MyTable where MyDate <= $(vYesterday);


talk is cheap, supply exceeds demand
Not applicable
Author

No guys, this don't work because the users could put another value in the input box and this will not work anymore

maxgro
MVP
MVP

for me Gysbert isolution works

input box (variable test),

today()-1

script

let test2 = $(test);

Table:

LOAD *;

SQL

SELECT *

FROM "sisim_stat".dbo."d003_date"

where dat_data >= $(test2);

Not applicable
Author

This is true but the problem with this solution is that the users will see 'Today()-1' instead of '30.01.2014' for today in the input box.

maxgro
MVP
MVP

use a calendar based on the variable test and in number tab choose date

Not applicable
Author

How can i use a calendar based on a variable?

maxgro
MVP
MVP

From Menu

R Click on sheet --> New Sheet Object --> Slider/Calendar Object.....-->

In General Tab choose Calendar (Input Style) and Variable(s)

calendar variable.jpg