Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar object to pick multiple date types

Hi Guys,


In my data model I have more then 10 different Date Types.

I have created 2 calendar objects to pick 'To' & 'From' dates

What am I trying to do..

I want the Users to chose type of date when they select 'To' & 'From' form the calendar object.

Example:

If user selects date type as 'Delivery Date' then it should only show orders delivered within selected date range.

If user selects date type as 'Shipping Date' then it should only show orders shipped within selected date range.

I have attached sample QVW with sample QVD with sample data set.


About the attached Application..

  • I have created a date link table and then created a master table.
  • Two variables as 'vStartDate' & 'vEndDate' to select min and max date from common date field called 'Date'
  • Every time variable changes, a trigger will make selection in the 'Date' Field in Master Calendar

Thank you in advance for your time, ideas and advice

11 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

I may have simplified the whole logic a bit too much, but the example below does everything using variables and expressions (and a few buttons). The trick in this example is that Select field and Clear field actions allow you to embed a $-sign expansion in the target field name. Using a variable to select the date field from a predefined (i.e. hard-coded) list, does away with everything in the master calendar and the link table. Of course you'll need those two for other uses like set analysis and such.

Calendar object to pick multiple date types thread218312.jpg

Note: if you don't like the extra selection step using a GO!-button, copy its action back into the calendar field event triggers and drop the button. I did remove the variable actions because I don't really like the automatic propagation of special "artificial" selections.

Also note that I applied a different min/max date expression for the two calendar objects, as to not let them end up on the wrong side (like Start Date > End Date). If you don't like that approach, change them back to your default logic.

Best,

Peter

mithunr40
Contributor III
Contributor III

Hi Peter,

I have one dought in vDateSelection variable what logic you have written.

I am not able to understand.

Please help

Thanks