Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

kostiskampouris
New Contributor II

Reload Based on selection

Hello everyone!

As the title says I want to reload based on the users selections in a date field.

I read the posts that I found in the community every solution is shown in qv documents which I cant open beacause I have the desktop edition.

My source is an sql database and the script I have trid so far is

Select * from table where dt=$(vdate)

Can someone help please?

3 Replies
MVP
MVP

Re: Reload Based on selection

Everything put in a SELECT statement will be sent to the DB driver and needs to match the DB syntax.

So it will depend how you've set the vdate variable and how you need to write the WHERE clause in your DB syntax.

Re: Reload Based on selection

You can create a Calendar object that stores a single selected date from a specific period (use Min / Max fields to set the start and end of your calendar) in a variable. Variable values will survive a reload (if you do not modify them in your script) so if you format your vdate value based on the variable value from your calendar, you will be fine.

Most databases accept date values in database format i.e. a string formatted as 'YYYY-MM-DD'. If we assume a calendar variable called vCalendarDate, your code could look like:

LET vdate = text(Date(Date#(vCalendarDate), 'YYYY-MM-DD'));

Table:

SQL SELECT * FROM table WHERE dt = '$(vdate)';

Best,

Peter

Re: Reload Based on selection

Hi,

Possible logic could be

1: create variable in variable overView

vReloadDate

like

;

Test:

Sql select * from tableName

where date=$(vReloadDate);

2: create island master calendar.

3: In front end Give user to select calendar date and Reload button

action on Reload button

1: set Variable

Name : vReloadDate

value : =GetFieldSelections(date_from_master_calendar)

2: Relaod

Regards

Regards,
Prashant Sangle