Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

syntax problem less than or equal to addyears with variable

hi Guys!

hope you could help me out.

I would like to calculate a sum till a certain time point in previous year, depending on what do I choose in a variable, below is what I came up with, nevertheless it doesn't work, although similar builds in the project do.

Sum({$<

[Date]= {"$(<=addyears(date('$(vRollingForecastBeginning)'), -1))"}

>}

ActualsValue)

The expression alone:

addyears(date('$(vRollingForecastBeginning)'), -1)

returns '07/01/2016' and reacts to variable changing correctly, [Date] is formatted as Date in script so the formats should be aligned.


do you have any ideas?


thanks in advance,

Bart



1 Solution

Accepted Solutions

Re: syntax problem <= addyears with variable

Your expression should be rather look like:

Sum({$<

[Date]= {"<=$(=addyears(date('$(vRollingForecastBeginning)'), -1))"}

>}

ActualsValue)

- Marcus

5 Replies

Re: syntax problem <= addyears with variable

Your expression should be rather look like:

Sum({$<

[Date]= {"<=$(=addyears(date('$(vRollingForecastBeginning)'), -1))"}

>}

ActualsValue)

- Marcus

Community Manager
Community Manager

Re: syntax problem less than or equal to addyears with variable

Hi Bartosz,

I've edited the title of this thread to replace "<=" with "less than or equal to", as the symbols were cause a page display issue.

Best regards,

Qlik Community Team

Not applicable

Re: syntax problem less than or equal to addyears with variable

hi Marcus,

works like a charm, thank you!

I wonder why in some case you need the additional "=" and in some you don't...

best

Bart

Not applicable

Re: syntax problem less than or equal to addyears with variable

hi Jeremy,

thanks!

regards,

Bart

Re: syntax problem less than or equal to addyears with variable

Here it's very well explained why and where the "=" made a difference:

The Little Equals Sign

The Magic of Dollar Expansions

- Marcus

Community Browser