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

Date Range Slider

Hello,

Has anyone successfully create a date range slider in Qlik Sense? I have a table in the sheet but want to use a date range slider for filtering the data. I have searched all over the internet and could not find a good solution. I have Vizlib in Qlik sense but the slider was not meant for Date. Maybe I just don't know how to use it. Any suggestions or ideas are greatly appreciated. Thanks in advance!

David

Labels (2)
2 Replies
daturpin
Partner - Creator II
Partner - Creator II

I realize this is several years old, but I have successfully done it.

0: Have a table that contains a date, date-time, etc., recognizable as a date or date-time within Qlik.  Here is a table I am using:

a table with a date-time columna table with a date-time column

1: Insert the Vizlib Slider

2: Create a variable, I called mine "slider_time"

3: Within the properties of the slider, set the Min and Max of the slider based on the date-time column in your table:

VizLib Slider propertiesVizLib Slider properties

Since I want the slider to be able to select as fine as one hour, I wrote my Min/Max functions as:

=round(Min(game_time), 1/24)

=round(Max(game_time), 1/24)

The Slider will now display the date-time as a floating point number. It is of the format "days passed since December 31, 1899". So don't be surprised when it is in the 45,000 range. I HAVE NOT FIGURED OUT HOW TO FORMAT THIS CORRECTLY YET.

It still works though.

4) In my table, I want it to only show actions that have happened by the date on the slider. To do this, within the properties for the table, go to Columns, and write something like this in the Field expression:

=if($(slider_time) - [game_time] >= 0, game_time)

(Make sure you use the $ so it updates whenever the slider position changes)

Now the table will filter based on the Vizlib slider:

Slider near the left (Min)Slider near the left (Min)Slider advancedSlider advanced

Hope that is helpful for others in the future looking to solve this.