Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis 'or' condition

hello,

i want to do :

count(resultat_1={''} AND (provenance ={'xx'} or provenance2={'yy'}),test_Num)


how can i do that?

thank you

7 Replies
Anil_Babu_Samineni

Like tis


Count({<resultat_1={''} , provenance2 = {'xx' or 'yy'}>} test_num)


OR


Count({<resultat_1={''} , provenance2 = {'xx'} or provenance2 = {'yy'}>} test_num)


OR


Count({<resultat_1={''} , provenance2 = {'xx'} or {'yy'}>} test_num)


But, your expression does seems two fields are different, Can i know these two diff


provenance & provenance2


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master
Master

Hi Rachel,

          Try:

count({$<resultat_1={''}>*(<provenance ={'xx'}>+<provenance2={'yy'}>)}test_Num)


Good Luck


Andrew

sunny_talwar

Another option could be this, in addition to effinty2112‌'s solution:

Count({<resultat_1 = {''}, provenance = {'xx'}> + <resultat_1 = {''}, provenance2 = {'yy'}>} test_Num)

Anonymous
Not applicable
Author

thanks Sunny T. but its not working .......... any other idea?

Anonymous
Not applicable
Author

its 2 differents things.

resultat_1 has to be empty and (field_1 should be {'xxxx','yyyy' } or field_2 should be {'xxxx','yyyy' })

sunny_talwar

Would you be able to share a sample where this isn't working? Also share what the output you are expecting to see

effinty2112
Master
Master

Hi Rachel,

                    Have you tried Sunny's suggestion or mine? They should both give the same, hopefully correct, answer. If they return a value which is not what you expect please advise.

I hope you're not put off by the set arithmetic. You have three conditions:

A = resultat_1={''}

B = provenance ={'xx'}

C = provenance2={'yy'}

The statements inside the <> brackets define sets, collections of records. When Sunny writes <A,B> then this is a set where conditions A and B are BOTH true and when his two sets are written with the operator '+' such as

<A,B>+<A,C>

then we're looking at the union of the two sets that he defined in the brackets. Overall we're picking the set where  (A and B) or (A and C) are true.

Mine is written differently but it means the same. the '*' means intersection of two sets i.e. the records that belong to both.

A and (B or C) is the way I wrote it.

Either way you get:

Venn.JPG

I hope I've not bored you with something you're already familiar with!

Kind regards

Andrew