Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Neha_2227
Contributor II
Contributor II

Set Analysis with AND condition

Hi Team,

In my dataset there is 1 flag which has values Y and N. There are few customers in Y and few in N but there are common customers as well which has both Y and N status. I want to show the common customers. Is it possible to achieve in front end with set analysis. 

I tried this expression - Sum({<Doubtful={'Yes'},Doubtful={'No'}>}Amount) 

This is giving me all the customers not the customers that have both doubtful Y and N.

Any suggestions to do it in front end.

Thank you 

Best Regards

Neha

7 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @Neha_2227 ,

 

Please give it a try with below expression 

sum(if( Doubtful='Yes' and Doubtful='No' ,Amount)) 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Neha_2227
Contributor II
Contributor II
Author

This wont work as Doubtful field doesn't have both values together, either it has Yes or No at time.

abhijitnalekar
Specialist II
Specialist II

Hi @Neha_2227 ,

Got it...

Is it possible to share the sample data?  want to check if my second logic works or not

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
NitinK7
Specialist
Specialist

try below expression

Sum({<Doubtful={'Yes'} > * <Doubtful={'No'}>}Amount) 

 

Neha_2227
Contributor II
Contributor II
Author

Here you go

Vegar
MVP
MVP

As you pointed out, each row only have Yes or No. An intersect between the two will not give any result. Consider looking at implicit set analysis using E(). I will look something  like this:

Sum({<CustomerId =P({<Doubtful={'Y'} > } CustomerId) * <CustomerId =P({<Doubtful={'N'} > } CustomerId)>}Amount) 

NitinK7
Specialist
Specialist

Hi,

Please find the attached .QVF file

Might be this will help you.

NitinK7_0-1637571891552.png