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: 
pedrohenriqueperna
Creator III
Creator III

How to make this expression respect filter?

Hi,

I have a expression that works with alternate states that is applied to a filter, for which I'm using as an 'exclusion' filter. Whatever is selected in this specific filter, will remove customer_ids from the calculation.

Everything works fine, except it won't respect the customer_id filter selections (not the exclusion, but a normal filter)

How can I make this expression respect the customer_id selected and still work with the 'exclusion' filter?

 

Count(Distinct {<customer_id = E({BrandExclusion<product_brand = {$(=chr(39)&GetFieldSelections(product_brand_exc,''',''',20,'BrandExclusion')&chr(39))}>} customer_id)>} customer_id)

 

therealdees_0-1712588120059.png

 

In the picture above you can see the KPI (Clientes 14.602) is calculating considering every customer_id that matches the set analysis condition of the excluded brands and ignores the fact I'm filtering a single customer_id (81895). What I need is to display data for the selected customer_ids (if selected at all) and also exclude the registry if the customer has bought any of the brands selected in the 'exclusion' filter

 

PS: I changed the field names to facilitate understanding of the expression; key_cliente = customer_id

Labels (2)
1 Solution

Accepted Solutions
rubenmarin

Hi, can you try with?:

Count(Distinct {<customer_id = P(customer_id) * E({BrandExclusion<product_brand = {$(=chr(39)&GetFieldSelections(product_brand_exc,''',''',20,'BrandExclusion')&chr(39))}>} customer_id)>} customer_id)

View solution in original post

1 Reply
rubenmarin

Hi, can you try with?:

Count(Distinct {<customer_id = P(customer_id) * E({BrandExclusion<product_brand = {$(=chr(39)&GetFieldSelections(product_brand_exc,''',''',20,'BrandExclusion')&chr(39))}>} customer_id)>} customer_id)