Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
_fl
Contributor
Contributor

PROBLEM: AND-MODE selection for Qlik Sense

Hi All,

Below an exercise I am trying to solve but I can't find a solution.

Starting with a database with products that may have different configurations:

GoodsAttributes
Product 1A,B,C
Product 1D,E
Product 1A,C,T
Product 2E,D,G
Product 2A,H,C
Product 3B,C,E
Product 3A,D,E
Product 3B,D,F,R
Product 3A,B,C,D

 

1) In the data model, I uploaded the table above and inserted a column "Elementary Attributes"obtained through a Subfield of the column Attributes

2) On a dashboard, I created a table with both the columns above and a filter on the Elementary Attributes(A;B;C;D;E;F;G..).

What I need to do is to filter all the rows that have in the column Attributes all the elements that I have filtered.

For example, if I select in the filter the elements A and I need to see the following rows:

GoodsAttributes
Product 1  A,B,C
Product 1A,C,T
Product 2A,H,C
Product 3A,B,C,D

 

And not the result that the basic filter does with OR selection (below):

GoodsAttributes
Product 1A,B,C
Product 1A,C,T
Product 2A,H,C
Product 3B,C,E
Product 3A,D,E
Product 3A,B,C,D

 

I tried a few work-around on it but could not find a solution.

Looking forward to hearing Your opinion, I thank you in advance for your help.

1 Solution

Accepted Solutions
OmarBenSalem
Partner - Champion II
Partner - Champion II

Create a table with 2 dimensions:

dim1: Good

dim2 : =aggr(if(GetSelectedCount(ElementaryAttributes)=0,Attributes,
if(len(trim(KeepChar(Attributes,Concat(distinct ElementaryAttributes))))=len(trim(Concat(total distinct ElementaryAttributes))), Attributes)
),Goods,Attributes)

 

Result:

No selection:

 

Capture.PNG

Select A and C:

Capture.PNG

 

 

View solution in original post

2 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

Create a table with 2 dimensions:

dim1: Good

dim2 : =aggr(if(GetSelectedCount(ElementaryAttributes)=0,Attributes,
if(len(trim(KeepChar(Attributes,Concat(distinct ElementaryAttributes))))=len(trim(Concat(total distinct ElementaryAttributes))), Attributes)
),Goods,Attributes)

 

Result:

No selection:

 

Capture.PNG

Select A and C:

Capture.PNG

 

 

_fl
Contributor
Contributor
Author

It worked, thank you very much!! 🙂