Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Zerker
Contributor
Contributor

Date filtering in reporting

I am trying to set up a 2 qlik report filters one that filters to the last month. And one that filters to the previous year.  The expressions i try in the actual app works, but not in the reporting filter.

Prior year

=[Repair Date]>=(AddMonths(Today(),-12))

for this one when i just do = and no > it will bring back data from current date from last year

Previous month 

MonthStart(Date([Invoice Month])) = MonthStart(AddMonths(Today(), -1))

 

Labels (1)
3 Replies
Andrea_Bertazzo
Support
Support

hi @Zerker

If you need to filter the last year, you can use something like this:
Year([Repair Date]) = Year(Today()) - 1

If you need to filter the latest 12 months, the formula seems fine, but there may be incompatibilities related the the format of the [Repair Date] filed. 
Maybe you can force it to a date format:
=Date([Repair Date])>= Date((AddMonths(Today(),-12)))

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up ! 🙂
Zerker
Contributor
Contributor
Author

Neither one worked.  Below is the format of my date field

 

Zerker_0-1776957005851.png

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Zerker 

Your screenshot is showing mask in which your field is loaded. You need to screenshot us more details in there (tags) which would indicate if field is actually loaded as date (and therefore can be filtered as date) or maybe an asci text and cannot. This is critical to for the filter to be properly configured.

Lech_Miszkiewicz_0-1777418667337.png

 

Also, have you selected search option?

Lech_Miszkiewicz_1-1777419511399.png

I have created test app and applied your filter and it works on my end so you may need to either double check your syntax or make sure you follow the steps provided above to check what is not working. Another thing is whether or not you are applying any other filters? They may be affecting search string by data association!

Lech_Miszkiewicz_2-1777420004613.png

 

Cheers

Lech

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.