Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Set analysis and start month


my name is Betty and I'm new at this. I want to make a set analysis where I compare this years sale to last years sale and I want to start from January. I've actually made one, but can't seem to figure out how to make it start from january. Can you please help me out a little? =)

This is the expression I've written (know that I don't use dollar signs since I' m a swede):



Also, this store opened 2014 and so I only have sales information from 2014-2015, but let's say that 2016 comes. I don't want to have to write another expression only for that year. Is there also a better way to make an expression that will apply to all years?



4 Replies
Valued Contributor II

Re: Set analysis and start month

Hi try like this to get current , and previous  n years :

current year :


last year :


past last year :



Not applicable

Re: Set analysis and start month

Hi Betty,

You could try using variables to define current and previous year:

- vCurrentYear = Year

- vPreviousYear = Year -1

Then add the variables to your set analysis:

- CY Sales = sum({<year = {$(vCurrentYear)}>} Sales)

- PY Sales = sum({<year = {$vPreviousYear}>} Sales)

Once you select 2015 second column will update to 2014. If you want to work with real dates, you can use Now() and Year() functions as well.

Good luck!


Not applicable

Re: Set analysis and start month

Thank you guys for answering so quickly! I managed to fix it yesterday =D

Community Browser