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

Excluding some values

Hi all,

I have a question concerning the exclusion of some values.

I have a dimension Year= 1998, 2013, 2014, 2015, 2016

And I have the dimension Month= jan ... dec.

When I create my report, I select the current month and year. A couple of my tables only show he results for that specific month and year. One of my tables however is a chart with all months visbible, so I use Month= in my expression. That's that.

But I also want multiple years visible. This is where the issue lies: I only want 2014, 2015 and 2016.

Problem is, to create my report, I selected '2016' and I cannot write Year= because that would also show me results for 1998 and 2013 in this specific chart (and I do not want those years being visible).

I tried to use the combination of both Year= in my expression and a calculated dimension saying =if(Year='2014' OR '2015' OR '2016', Year) but that does not work unfortunately, it still shows me all of the values for Year. Apparently an expression is 'stronger' dan a calculated dimension.

How can I solve this issue?

Thanks in advance!

1 Solution

Accepted Solutions
3 Replies
ali_hijazi
Partner - Master II
Partner - Master II

if your expression is Sum(Sales) then to exclude the year 1998 you write the following:

sum(${<Year={'*'}>-<Year={1998}>} Sales)

* means all years (Nulls are excluded)

or

you can write sum({<Year -={1998}>}Sales)

I can walk on water when it freezes
Not applicable
Author

Thanks for the link!

Using = - {} instead of - = {} did the trick!