Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Filter a dimension without an aggregator?

So I quickly figured out how to "filter" a count, like so:

Count({$<Color={'blue'}>}Color)

This would only show the number of "blue" items.

However, I cannot figure out how to list all blue items.  Let's say I have a column for "Color" that has values of Red, Green, Blue, Orange, Purple and Pink.  How can I only display items that are Red, Green or Blue?  I tried variants of the above based on my coding expirience, such as:

{$<Color={'blue'}>}Color


But had no luck.

1 Solution

Accepted Solutions
Not applicable

Re: Filter a dimension without an aggregator?

Okay I got it working using the following code:

if((Color= 'Red') OR (Color = 'Green') OR (Color = 'Green'),Color)

Awesome.  BUT.  I tried to do the opposite and exclude colors.

if((Color -= 'Yellow') AND (Color -= 'Purple') AND (Color -= 'Orange'),Color)

This does not work.  The documentation I found says -= is not equal.  The error is ") Expected"


I'll open this in a new question since I technically answered the original one.

2 Replies
Not applicable

Re: Filter a dimension without an aggregator?

So I found a document here: Set Analysis: syntaxes, examples which listed the following example: 

{<MANUFACTURER_LDESC = {"AMBOISE","BELLE"}, CATEGORY_LDESC={"ACC", "COLD PLATES”}>}

The validator shows "Garbage after expression '='".


Adapting to my example, {<Color = {'Blue','Red','Green'}} also gets the garbage error.

Not applicable

Re: Filter a dimension without an aggregator?

Okay I got it working using the following code:

if((Color= 'Red') OR (Color = 'Green') OR (Color = 'Green'),Color)

Awesome.  BUT.  I tried to do the opposite and exclude colors.

if((Color -= 'Yellow') AND (Color -= 'Purple') AND (Color -= 'Orange'),Color)

This does not work.  The documentation I found says -= is not equal.  The error is ") Expected"


I'll open this in a new question since I technically answered the original one.