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

vLastYear and vThisYear question

Hi,

I'm wondering if vLastYear and vThisYear is a universal thing in Qlikview or if it has to be set up in my Master calendar somehow?

Cause as it is right now I don't seem to get it to work. I'm trying some stuff out and found this expression I'm experimenting with but can't get it to work:

if(sum({$<Year = {$(vLastYear)}, Month = {"<=$(vThisMonth)"}>} LineSalesAmount) > sum({$<Year = {$(vThisYear)}, Month = {"<=$(vThisMonth)"}>} LineSalesAmount),

0,

sum({$<Year = {$(vThisYear)}, Month = {"<=$(vThisMonth)"}>} LineSalesAmount) - sum({$<Year = {$(vLastYear)}, Month = {"<=$(vThisMonth)"}>} LineSalesAmount)

)

1 Reply
sunny_talwar

It is not a universal thing and these variables need to be created either in the script or using the variable overview