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

Announcements
Data Works for AI is here - Join the discussion and enter to win a pair of Qlik kicks: Join the Conversation!
cancel
Showing results for 
Search instead for 
Did you mean: 
vkal12
Creator
Creator

Dynamic date filter in Qlik Cloud Reporting Services

Dear Community,

Is it possible to create a dynamic filter for a date field in Qlik Cloud Reporting Services? Currently, we generate many reports by dynamically calculating the previous day using the formula: `=Date(Today()-1, 'DD.MM.YYYY')`. This works as intended. However, I would now like to implement the following requirement: if the day of the week is Monday, I want the report to display data for yesterday, the day before yesterday, and the day before that (i.e., the last 3 days). Is this possible?

I look forward to your replies.

Thank you and kind regards 🙂

Labels (1)
  • Cloud

2 Replies
marksouzacosta
MVP
MVP

Hi @vkal12,

I think you can use the Weekday function in an If Statement, do the math needed, and compare it against your Report Date field.
https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFun...

Something like this:

=Date(Today()-If(WeekDay(Today())=1,3,1), 'DD.MM.YYYY')

 

Your report field should be greater or equal the value returned by the expression above - and maybe less or equal Today() date if needed.

 

Regards,

Mark Costa

 

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

vkal12
Creator
Creator
Author

Hi Mark, thanks for your reply. I actually want to cover a specific time range. If it’s Monday, my report should include data from Friday, Saturday, and Sunday—meaning the last three days. If it’s Tuesday, it should only include the previous day—Monday. Is this possible using the filters in Qlik Cloud Reporting Services?