Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
niranjana
Creator
Creator

Excluding two products

Hi ,

 I have a requirement where I have to show two markets: all products in first market and in second market all products except two.

 

I tried this but didnt work.

if(Brand_Market='NS Range',Brand_Product) and if(Brand_Market='Gilenya Market',if(not match(Brand_Product,'Gilenya','Mayzent'),Brand_Product))

Thanks in advance

 

Labels (1)
4 Replies
Or
MVP
MVP

Perhaps something along the lines of:

if(Brand_Market='NS Range' OR (Brand_Market = 'Gilenya Market' and not match(Brand_Product,'Gilenya','Mayzent')),Brand_Product)

Assuming you prefer this as an if() rather than set analysis.

niranjana
Creator
Creator
Author

HI,

Thanks for your reply. I would prefer to limit in dimension because using set analysis in expression would be too long. BUt this expression doesnt work

 

Thanks

Or
MVP
MVP

I tested this using inline data and it works as expected when used as a measure. In your scenario, the specific data structure / context may not allow this to be used as a calculated dimension, in which case you will likely have to use aggr() to work around that.

Note that this is not a recommended approach in general. It would be better for performance to create this field in your script (using the formula already provided) and then using that field as your dimension:

Load *, if(Brand_Market='NS Range' OR (Brand_Market = 'Gilenya Market' and not match(Brand_Product,'Gilenya','Mayzent')),Brand_Product) as Brand_Product_For_Chart

From YourTable;

niranjana
Creator
Creator
Author

Hi,

Thanks for you reply! The requirement is changed and I need to modify the question a bit . If I select Brand_Market='NS Range', products of NS Range and products of Gilenya Market excluding the two products must be visible. For other markets, as usual all corresponding brand prodcuts must be visible.

Quick response is appreciated.

 

Thanks in advance