Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

balajisj30
Contributor

How to include selected year and previous year in bar chart

Hi people

How to include sales values of the selected year and previous year in the same bar chart.

qlik1.PNG

Thanks

Balaji

1 Reply
Partner
Partner

Re: How to include selected year and previous year in bar chart

let's suppose that ur measure is :

sum(Measure)

and that u have a field called YearField in ur data

in ur bar chart:

as dimension : YearField

as measures:

1) sum({<YearField={"$(=max(YearField))"}>}Measure)  //this is the selected year

2) sum({<YearField={"$(=max(YearField)-1)"}>}Measure)  //this is the selected year-1