Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 🙂
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
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?