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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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.

View solution in original post

2 Replies
Not applicable
Author

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
Author

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.