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

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
MVP
MVP

Re: Re: Retrieve value of an input box

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

9 Replies
Not applicable

Re: Retrieve value of an input box

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

Re: Retrieve value of an input box

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?

Re: Retrieve value of an input box

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

Re: Retrieve value of an input box

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

MVP
MVP

Re: Retrieve value of an input box

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

Re: Retrieve value of an input box

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.

MVP
MVP

Re: Retrieve value of an input box

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

Not applicable

Re: Retrieve value of an input box

How can i use a calendar based on a variable?

MVP
MVP

Re: Re: Retrieve value of an input box

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

Community Browser