Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exclude data from dimension

Hi !

My question is simple, but I got stuck with it. I've got a dimension (year) on a bar chart, but there is too many informations on it.

years= 2011,2012,2013.

I want that my chart only shows me the last two years instead of all the years, without having to select them in a selection list.

how can I do it ?

Thanks in advance.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Instead of year, use below expression in your list box expression

=IF(Year> Max(TOTAL Year)-2, Year)

Or

IF(Year> Year(Today())-2, Year)

View solution in original post

3 Replies
MK_QSL
MVP
MVP

Instead of year, use below expression in your list box expression

=IF(Year> Max(TOTAL Year)-2, Year)

Or

IF(Year> Year(Today())-2, Year)

PradeepReddy
Specialist II
Specialist II

Write the calculated expression... as suggested by Manish

=IF(Year_Field>=Max(Year)-1,Year)   ---Takes the 'max year' from the available data

or

=IF(Year_Field>=Year(today())-1,Year)  -- Takes latesr 2 years data including this year

tobias_klett
Partner - Creator II
Partner - Creator II

put this set analysis statement in each expression:
{<Year={'>$(=(max({1}Year)-2))'}>}