Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
beanologie
New Contributor

Display only 2019 data in gauge visualization

I am tracking progress against a goal using a gauge visualization. My field contains 2018-2019 data, but I would like the gauge to show ONLY 2019 data. I'm a bit new to Qlik and not sure where to start.

2 Replies
vishsaggi
Esteemed Contributor III

Re: Display only 2019 data in gauge visualization

Can you show some sample data and how it looks? You can restrict based on your date field.
Partner
Partner

Re: Display only 2019 data in gauge visualization

if u have a Year field:

sum({<Date,Year={'2019'}>}Measure)

or

sum({<Date,Year={"$(=max(Year))"}>}Measure) // shows the max year : 2019, but if u select 2018, 2018 would be the max of 2018, so this depends on the selection

or 

sum({<Date,Year={"$(=max({1}Year))"}>}Measure) //always show 2019 (max year) no matter the selection ( the {1} part does this)

Please, seach for tutorials on set expression- Qlik

ps: if u have only Date field : 

1) create a year field in the script and use it : Year(Date) as Year

2) use this expression

sum({<Date={">=$(=YearStart(max(Date)))"}>}Measure) // depends on the selection

or

sum({<Date={">=$(=YearStart(max({1}Date)))"}>}Measure) // does not depend on the selection