Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable Syntax

I need to create two variables. The first is the start month of my fiscal year and the second my fiscal year start month +12. I currently have the two below variables but the syntax is incorrect.

Any help would be greatly appreciated.

=date(monthstart(04-2011),'MM-YYYY') (This is titled vStartMonth)

=date(addmonths(vStartMonth,12),'MM-YYYY') (This is titled vFiscalYear)

Thanx

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi, you can write the first like this:

date(monthstart(date#('04-2011','MM-YYYY'))) (without the = on the variable definition)

date(addmonths(($(=vStartMonth)),12),'MM-YYYY') (for vFiscalYear, also without the 😃

When you need to include it in a text box, you can call it like this:

=$(=vFiscalYear)

View solution in original post

1 Reply
erichshiino
Partner - Master
Partner - Master

Hi, you can write the first like this:

date(monthstart(date#('04-2011','MM-YYYY'))) (without the = on the variable definition)

date(addmonths(($(=vStartMonth)),12),'MM-YYYY') (for vFiscalYear, also without the 😃

When you need to include it in a text box, you can call it like this:

=$(=vFiscalYear)