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

Right expression?

Hi,

I have a column Product with values Soaps Dove, Soaps Caramel, Soaps Lux, Soaps Santhoor, Detergents XX,Detergents YY,Detergents DDFDG .

I would need to show the count of IDs which will start only with Soaps in dimension

I tried using below

Dimension: =IF(WildMatch(Product,'Soaps*'),Product)

Expression: Count(Distinct(ID))

But I doubt whether the expression is correct or not could anyone suggest me.

Thanks.

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

Try:

count(distinct {<Product = {'Soaps*'}>}ID)

View solution in original post

5 Replies
m_woolf
Master II
Master II

Try:

count(distinct {<Product = {'Soaps*'}>}ID)

Not applicable
Author

Thanks. It is showing 'Error in calculated condition'. sorry if I am wrong.I don't want to change expression instead want to change dimension.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You could just use Product as the dimension and Count({<Product={"Soaps*"}>} Distinct ID) as the expression. For the dimension, set the checkbox for suppress nulls.

HTH

Jonathan

Edit: I try to avoid calculated dimensions where possible. This is a case that will perform better with a fixed dimension and a filtered expression.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks. Can I use this as dimension

=If(WildMatch(Product,'Soaps*'),Product)

Not applicable
Author

Thanks.