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

Dynamic previous day filter for table box

Hi,

My application has two filters: current date and previous date.

When a user selects a date, such as today, in previous date the value is -1 and display it in the table box.

Now the requirement is the previous date must be dynamic, which implies that it must default to the current date-1 while still allowing users to pick any other previous dates concurrently.

 

Labels (1)
1 Reply
edwin
Master II
Master II

if i understand it correcty, you have 2 fields CURRENT DATE and PREVIOUS DATE.  what you want is when the user selects CURRENT DATE, you want PREVIOUS DATE to default to CURRENT DATE -1.

Are you using Qlikview?  if so, add a field event on CURRENT DATE when selected, select PREVIOUS DATE

if you are using QLik Sense, unfortunately, there are no triggers that will select a 2nd field when you select any field.  however, you can associate CURRENT DATE to all PREVIOUS DATEs that are <CURRENT DATE.  meaning, all dates prior to CURRENT DATE are now selectable.  then create a variable that gets the date(max(PREVIOUS DATE)) and use that in your calculation as set analysis modifier.  this means CURRENT DATE -1 becomes the default should no selection for PREVIOUS DATE be made.  the user can then select any PREVIOUS DATE and since max(of the selected PREVIOUS DATE) = selected PREVIOUS DATE then it gets inserted into your calculation

vPreviousDateDefault = date(max([PREVIOUS DATE]))

your expression will need the set analysis modifier

{<[PREVIOUS DATE]={'$(vPreviousDateDefault )'}>}