Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
paul1204
Contributor
Contributor

Possible Syntax Error. Dynamic Date for bookmark

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?

Here's some screenshots to illustrate. 

paul1204_0-1724261626782.png

 

Heres the bookmark

paul1204_1-1724261737168.png

 

 

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

 

paul1204_2-1724261809477.png

 

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! 

Labels (1)
3 Replies
Sayed_Mannan
Creator II
Creator II

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.

 

MatheusC
Specialist
Specialist

@paul1204 

Look like this, inside the search box:

=[POI Date.Year]=Year(Today())

- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
pollard
Contributor
Contributor

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.