Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have created a report via the reporting service and I would like to select the current weekending date in one of the selection fields.
I cannot work out what I need to put in the date formula to acheive this? It needs to be dynamic always working from todays date.
Can anyone help with the formula I would need to use please? I have tried using weekend(today) and weekend(now) but it doesn't seem to be happy with that. Is there a way to achieve this?
Many thanks.
The date of the last day of the week can be calculated by
Date(Floor(WeekEnd(Today())))
or
Date(WeekStart(Today(),1)-1)
It is however unclear how you want to use this. One way could be to use it in a set expression:
Sum({<Date={"$(=Date(WeekStart(Today(),1)-1))"}>} Amount)
Then the measure will be calculated for this date only.
But since the day hasn't occurred yet, the result will probably be an empty set...
Thanks for the repsone Henric, however my question is specific to the date formula in the reporting service "set selection on report" area and it appears our usual qlik formulas do not work in here:
It is within the reporting service “Add Selection to Report” that I am trying to set a field called WeekEnding to be the last day of the current week.
Below you can see I have used now and the format M Y to get set a Roll Month field and this seems to work ok (so for today it will set the RollMonth field as May 2022).
My question is how do I set the WeekEnding selection in the reporting service with the current week ending date.
I can do this with hard coding if I use “now + x days” (where x is the number of days to the weekending of the date I want – shown below) but I need to do this dynamically. i.e. get the weekending date of the current week each day the report runs because this report will be scheduled to run each day and it should always run for the current week ending selection.
If I try to use the code we would usually use within Qlik as below it does not work.
The weekending selection is not set to anything (as shown in the output below):
Hence, I need to know what the formula in the reporting service is to get the weekending date of today if anyone can help with that.
Many Thanks.