Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Expression - Filter for dimension

Hi,

if i use a dimension in a chart and want to filter the values of the dimension, how can i do it?

Example

Dimension: Products

Filter: Name = "Samsung"

The chart should only show Products where "samsung" is found in the field name

regards,

sam

1 Solution

Accepted Solutions
MVP

Create it as a master dimension  as follow:

=if(Name='*Samsung*',Name,Null())

Example:

6 Replies
Luminary

Hello! Let's say you calculate the sum of sales. Then your expression would be:

Sum({<Name={'*Samsung*'}>}Sales)

vizmind.eu
Anonymous
Not applicable
Author

Hi,

yes, but how can i do it for dimensions?

regards,

sam

MVP

Create it as a master dimension  as follow:

=if(Name='*Samsung*',Name,Null())

Example:

Specialist III

As suggested by the two , you can achieve by writing a calculated dimension and also using set analysis.

Partner - Creator III

Hi,

You can also do it in script level where you can mention

if(upper(Products)='SAMSUNG','0','1') as ProductSpecificFlag

Later,you can use this in your calculated dimension,

if(ProductSpecificFlag='0',Products,Null())

This will take all values irrespective to any change in the cases of Samsung(upper case or lower case).

Hope it helps.

Anonymous
Not applicable
Author

Thanks to you and the others.

I use like instead = because if i used = it shows 0 results.

=if(Name like '*Samsung*',Name,Null())

thanks and regards,

sam