Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

YTD vs Last YTD Comparison

Hi Guys,

Could someone help me out a bit. I've already used the advice from topic: Year to Date vs Year to date Last Year

But for some reason my calculation doesnt works for the prioryear.

I added an image where you can see the variables and calculations.

Thnx!

11 Replies
rubenmarin

The date value is fixed, doesn't matter the selections, if manually changing the number works it means than the number format works and you can change to the expected format:

vPriorYearDate =Num(addyears(max(%datum_Key), -1))


The expression should work, if not try with double quotes:

=SUM({<calendar.Year={'$(vPriorYear)'},calendar.Month=,%datum_Key={"<=$(vPriorYearDate)"},calendar.YearMonth=>}omzet.Linetot)

Anonymous
Not applicable
Author

Hi Rubin,

Many thanks for the supreme support! Works perfectly now!!