Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Corona7
Partner - Contributor II
Partner - Contributor II

Calendar Object with Variable

Hi, I set a variable in my load script and i want use it in a calendar objetc ad in expressions.

Let Data_riferimento = date(today(0).'DD/MM/YYYY');

When i use the variable in my Calendar Object is show correctly

Corona7_0-1612048762963.png

Immagine.jpg

but after the load script and i use the variable in an expression it's no working

Corona7_1-1612048805227.png

The first expression is  (year(date($(Data_riferimento),'DD/MM/YYYY'))) & ' (YTD)' and i expect 2021 instead 1899.

Only if i select le date on the calendar object the date then then expression works.

Where is my mistake ? I need that after the load the variable is equal the formula date(today(0).'DD/MM/YYYY') and the expression wotks correctly.

Thanks

4 Replies
MayilVahanan

Hi @Corona7 

For your expression, $() not required.  try like below

= (year(date(Data_riferimento,'DD/MM/YYYY')))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Vegar
MVP
MVP

I see two possible issues with your expression. Try this adjusted version.

year(date#('$(Data_riferimento)' ,'DD/MM/YYYY')) & ' (YTD)' 

Corona7
Partner - Contributor II
Partner - Contributor II
Author

Thanks Mayil Vahanan, it's works! 👍

 

Corona7
Partner - Contributor II
Partner - Contributor II
Author

Thanks Vegar! It's works! 👌