Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

Re: vLastYear and vThisYear question

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