Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
beanologie
Contributor
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
Champion III
Champion III

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

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