Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Here is my problem : I would like to create a default bookmark for an app, with a dynamic slicer.
The slicer should always be the first day of the first month of the last year of the data, with the possibility for the user to remove it once the app is open.
I then encountered the following problems :
To create the slicer I tried using STARTYEAR(DateField), but it doesn't give what I need, because even if I get the right value (01/01/2026 if I have 2024, 2025 and 2026 in the data), it filters the whole year, and I would like to only filter on the first day.
Then I realised than even if I succeed in getting what I want, I will have the manually update the slicer every year, because once created the bookmark keeps the same selected value for the slicer.
So I followed the footsteps from here :
Always one selected value and default bookmark example in :
https://help.qlik.com/en-US/sense/November2025/Subsystems/Hub/Content/Sense_Hub/DataSource/select-si...
But there is also a problem, since the "always one selected value" means that the data will always be restricted to one day, and that is something I want to avoid.
Is there a way to solve both issues ?
Best regards.
Hi @User93
Ok, I think I did not understand well the request. I thought you always wanted to select the first day of the year (1st January). But I understand now that you want to select the first date of the year available in your data set.
If you have a Year field in the datamodel, you just need to replace the formula in the action for:
Min({<Year = {"$(=Max(Year))"}>} DateField)
If you don't have a Year field, the formula is a bit longer:
Min({<DateField = {">=$(=YearStart(Max(DateField))) <=$(=YearEnd(Max(DateField)))"}>} DateField)
Basically, in this way we select the minimum date for the maximum year. Let me know if it works for you.
Kind Regards
Daniel
Hi @User93
You can create a dynamic bookmark as described in this other post. Solved: using a variable in a bookmark - Qlik Community - 1884731
However, I'm not sure if I'm understanding your need. If you need to select the date by default only once the app is opened, should not be better to use an action? Like this:
In this way, every time that the app or the sheet is opened, the filter will be applied automatically, and it is easier to apply dynamic changes there. The formula I used is the following one and it seems to properly filter the beginning day of last year when applying the action:
YearStart(max(DateField))
Let me know if it works for you.
Kind Regards
Daniel
Hi,
Thank you for the reply !
The need is the following : when a user opens the app, he must land on the bookmark with the selected slicer : the first day of the first month of the last year. And then the user must have the possibility to remove it, so he can see more than one day.
I tried the solution with the variable =Year=$(vCurrentYear), and this part works.
For the second part, I can't use YearStart with Max, as Max turns the result into a measure, and can't be used as slicer.
Is there a solution for that point ?
Hi @User93
Ok, I think I did not understand well the request. I thought you always wanted to select the first day of the year (1st January). But I understand now that you want to select the first date of the year available in your data set.
If you have a Year field in the datamodel, you just need to replace the formula in the action for:
Min({<Year = {"$(=Max(Year))"}>} DateField)
If you don't have a Year field, the formula is a bit longer:
Min({<DateField = {">=$(=YearStart(Max(DateField))) <=$(=YearEnd(Max(DateField)))"}>} DateField)
Basically, in this way we select the minimum date for the maximum year. Let me know if it works for you.
Kind Regards
Daniel
Thanks a lot !
An action with the formula Min({<DateField = {">=$(=YearStart(Max(DateField))) <=$(=YearEnd(Max(DateField)))"}>} DateField) works as intended, it's exactly what was needed.
Best regards.