Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kostiskampouris
Contributor II
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
swuehl
MVP
MVP

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.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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

PrashantSangle

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

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂