Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Comparing data between years

I currently have my data of sales set out in a spreadsheet as below:

YearActual SalesSales TargetMonth

I want to show the data as a gauge and so how would I write the expression that would compare sales between one year and the next?


1 Reply

Re: Comparing data between years

Here is a sample using SET ANALYSIS to dynamically calculate the most recent year in the user's selection and show that year's actual sales as the needle in the gauge while adding a green reference line to denote the previous years actual sales

Also attached is the QVF for your inspection. Just put it in your  My Documents\qlik\sense\apps directory to see it in the destkop hub.

Note that on load i parsed your Year values to just show the first four characters ( ex:  2013/14 ->  2013)  . That made it easy to calculate the most recent year in the user's selection (ie:  max(year)  and previous year (ie :  max(year)-1)  . 

You can load both year formats and use a different field name for each if you want .

hope it helps