Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
drewwilliams
Contributor III
Contributor III

Using XOR on a dimension

Hello All,

I currently have an AND-mode listbox setup and would like to have another listbox that contains the items that the AND-mode listbox is excluding.

For example, if I have product 1, 2, 3, and 4 where their parts are listed as follows:

Product 1: A, B, C, E

Product 2: A, B, D, E, F

Product 3: A, C, E, G

Product 4: A, B, C, D, E

My AND-mode table for the parts when selecting Products 1, 2, and 4 will show: A, B, E

Question/Problem: I would like to have a second table that shows what is excluded but only from my selection so the second table should show: C, D, and F (but not G since that part is not in products 1, 2, and 4 which were selected)

I believe the XOR operation should do the trick but I'm unsure on how it can be applied to the part dimension to achieve the second table.

Any and all help is appreciated!

4 Replies
marcus_sommer

This could be possible with set analysis: Re: advanced Set Analysis with OR???

- Marcus

drewwilliams
Contributor III
Contributor III
Author

The thread you linked has XOR used within an expression. Currently I have a AND-mode listbox with Product 1, Product 2, Product 3, and Product 4. When items are selected within this listbox, I have another listbox showing their common parts.
I'm looking to apply the XOR to a listbox with the Products dimension so that my listbox with parts only shows the ones that are different between the selected products.

marcus_sommer

Maybe this is helpful: Multiple table selections Conditional especially the last thought by creating the conditions or part of it's (as flags) within the script.

- Marcus

drewwilliams
Contributor III
Contributor III
Author

I'm not sure that's exactly what I'm looking for.

When I make multiple selections within my and-mode table, I want to compare the parts that are different between the top three volume products.

I'm trying to achieve this with a code similar to this:

[Product 1 Parts] =if(GetSelectedCount(Product)>0, Only({<Product = {"=Rank(Sum({$} [Product Volume]))=1"}>} Parts))

[Product 2 Parts] =if(GetSelectedCount(Product)>0, Only({<Product = {"=Rank(Sum({$} [Product Volume]))=2"}>} Parts))

[Product 3 Parts] =if(GetSelectedCount(Product)>0, Only({<Product = {"=Rank(Sum({$} [Product Volume]))=3"}>} Parts)

then

[Product 1 Parts] XOR [Product 2 Parts] XOR [Product 3 Parts]


so that I only see the parts that are different between the top three selected products