Dynamically filtering by From/To dates
Quite often, users who are not quite familiar with the QlikView way of making selections, will ask for a From/To date selection option that they are used to from their previous reporting solutions.
We can do this using a couple of variables and an Action applied to a button.
Getting ready
Load the following script:
Load Date(TempDate) As Date, Year(TempDate) As Year, Month(TempDate) As Month, Date(MonthStart(TempDate), 'YYYY-MM') As YearMonth, (Year(TempDate) + Month(TempDate) + Day(TempDate)) * Rand() As Sales ; Load RecNo()-1+Floor(MakeDate(2012)) As TempDate AutoGenerate(730);
How to do it…
These steps will show you how to dynamically filter by From/To dates:
Add a new variable to the
vStartDate
document with a value of41275
(1st January 2013 – no particular reason for this value).Add a new variable to the
vEndDate
document with a value of41364
(31st March 2013).Create a new Line chart with dimensions of
Month
andYear
. Add the following...