Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I limit the values displayed for a Dimension in a chart?

I've been trying to limit the number of Years displayed in my chart to the most recent three years.  However the 'Dimension Limits' tab in the Chart properties only lets me limit the Dimension by the 'First', 'Largest' and 'Smallest number.  Is there another way?

This is the chart without limits set -

unlimited years.jpg

This is how I want it to look -

three years.jpg

Thanks

Greg

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

If your dimension name is Year then write as dimension (Click Edit button ...)

If(Year >= Year(Today())-3, Year, Null())

and check the box "Suppress null values

Let me know

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

If your dimension name is Year then write as dimension (Click Edit button ...)

If(Year >= Year(Today())-3, Year, Null())

and check the box "Suppress null values

Let me know

Not applicable
Author

Hi Greg,

Alessandro gave you an answer, if "the most recent three years" for you means always last 3 callendar years.

If that is not what you mean, try to write which years you want to choose.

Regards

Anonymous
Not applicable
Author

Thanks Alessandro.  That worked.

But it stops people from choosing other years in the list box.  Is there a way to get the chart to list the most recent three years by default but if someone chooses to show more than the most recent three years it will let them.

Thanks

Greg

Not applicable
Author

You can do it by calculating your dimension like this:

=If(GetSelectedCount(Year)=0,
If(Year >= Year(Today())-3, Year, Null()),
Year)

If you select any year, you will se this selected year/years.

If you don't select any year, you will see last 3 years (and current).

Anonymous
Not applicable
Author

Excellent!  Thanks very much Bartłomiej