Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello good people of the Qlik Community
We have a Year drop down and the User can select the Year they want to view.
The problem is that it defaults to year 2023 when entering the sheet.
We want to change it to use a dynamic value GL.Year = Year((Today(0)). but when doing so, the expression is blank on the bookmark.
What am I missing?
Heres the bookmark
Here's an example where it's hardcoded a year. We don't want a hardcoded year, would like to have Year(Today(0)) to keep it dynamic
I'm able to achieve this using the Action, but it only applies to one sheet in a application. Looking for more of a "global" config where all sheets in the app use Year(today(0)) as the Year selection
Cheers!
To set a dynamic default year in Qlik Sense bookmarks, you can use the following approach:
1. Create a new variable, e.g., vCurrentYear, with the definition: Year(Today()).
2. Create a bookmark with the desired selections. Instead of hardcoding the year, use the variable you created. For example, in the Year field, use =$(vCurrentYear)
3. Ensure that the bookmark is applied when the sheet is opened. You can do this by setting the bookmark as the default bookmark for the sheet.
This method ensures that the bookmark dynamically updates to the current year whenever the sheet is accessed.
If you encounter issues with the expression being blank, double-check the variable definition and ensure it is correctly referenced in the bookmark. Additionally, verify that the variable is properly defined and accessible in the context where the bookmark is applied.
Look like this, inside the search box:
=[POI Date.Year]=Year(Today())
- Matheus
To make the Year drop-down default to the current year dynamically across all sheets, you can use a variable to set the default value. Try creating a variable, say vCurrentYear
, and set its value to invisible text Year(Today())
. Then, set the Year drop-down to use this variable as its default value.
Ensure that you apply this variable setting globally by including it in the app's initial load script or through a global action. This way, it will automatically update the drop-down across all sheets with the current year.