Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Matt_Leonard
Contributor II
Contributor II

Tabular Reporting Date Filters

Hi there

I have an app that has a bookmark on Year and Month using CommonDate which I am wanting to replicate in a tabular report.

When I add a filter for year using CommonDate and evaluate year(now()) the report is blank.

 Is it also possible to use a date range in a filter?  When I try to add <= or >= I get an error in the formula.

Any help would be appreciated.

Thanks

 

 

Labels (1)
1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

For the dynamic filter I was able to get it to work using 'evaluate' or 'search' filters

As you can see below for an 'evaluate' filter the preview is correctly resolving to '2020' which (in my example) is now()'s current year 2024 minus 4 = 2020. 

This would not work on a 'Date' field though. I had to use it on a year field which was generated in the load script using  something like this:    Year([OrderDate]) as OrderDateYear 

 

JonnyPoole_2-1708013578222.png

JonnyPoole_4-1708014659656.png

 

 

JonnyPoole_1-1708013493202.png

You can do a year range with a two part filter like this: 

This filter ended up  filtering my report to the years from between 5 and 6 years ago  (in my case years 2018 and 2019 but not 2020+). 

JonnyPoole_3-1708014525038.png

 

View solution in original post

4 Replies
Matt_Leonard
Contributor II
Contributor II
Author

Hi Anat

I am looking at Tabular Reporting in Qlik SaaS rather than in app bookmarks.

 

Thanks

JonnyPoole
Former Employee
Former Employee

For the dynamic filter I was able to get it to work using 'evaluate' or 'search' filters

As you can see below for an 'evaluate' filter the preview is correctly resolving to '2020' which (in my example) is now()'s current year 2024 minus 4 = 2020. 

This would not work on a 'Date' field though. I had to use it on a year field which was generated in the load script using  something like this:    Year([OrderDate]) as OrderDateYear 

 

JonnyPoole_2-1708013578222.png

JonnyPoole_4-1708014659656.png

 

 

JonnyPoole_1-1708013493202.png

You can do a year range with a two part filter like this: 

This filter ended up  filtering my report to the years from between 5 and 6 years ago  (in my case years 2018 and 2019 but not 2020+). 

JonnyPoole_3-1708014525038.png

 

Matt_Leonard
Contributor II
Contributor II
Author

Hi Jonny

I couldn't get this to work due to the way that the app is set up but I have tried it on another app and it works perfectly.

I have managed to solve the issue with this app by creating 2 variables in the app:

$(vMonthStart) and $(vMonthEnd).

I then created a filter on CommonDate and using the 'search' function with the formula: 

=CommonDate>=$(vMonthStart) and CommonDate<=$(vMonthEnd)

 The report is now generating data as expected.

Many thanks

Matt