Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead 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
OmarBenSalem

Create it as a master dimension  as follow:

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

Example:

Capture.PNG

View solution in original post

6 Replies
Ivan_Bozov
Luminary
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

OmarBenSalem

Create it as a master dimension  as follow:

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

Example:

Capture.PNG

kkkumar82
Specialist III
Specialist III

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

anjali0108
Partner - Creator III
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