Forum Discussion
IF with text value & AND OPERATOR
- 5 years ago
Hi All,
I am posting for others reference as the issue with AND operator is if it is to compare two different columns it works fine but when is to compare two values from same column the AND operator or IN operator doesnt work.
In such case you have to use nested IF.
Cheers.
Hi amitchandak Thank you again , the first formula did return both 0 and 1 in the field option but choosing 1 it didnt seem to be fitlering as required.
The filter didn't return only those oppportunities that has both Mobile device and Accessories, it but returned all opportunities either having just Devices or Accessories.
As shown in picture, only one opportunity has both device and accessory.
schoden , if for the same set id (Device) if both are there
IF2 = if(countx(filter(Table, [device] =earlier([device]) && table[column] in { "Mobile Accessories", "Mobile Devices" }) ,[device])+0>=2, 1, 0)
Now if the can repeat you need to have a distinct count
IF2 = if( calculate(distinctcount(table[column]) , filter(Table, [device] =earlier([device]) && table[column] in { "Mobile Accessories", "Mobile Devices" }))+0>=2, 1, 0)
Both are new columns
- schoden6 years ago
Post Partisan
Hi amitchandak
IF2 = if(countx(filter(Table, [device] =earlier([device]) && table[column] in { "Mobile Accessories", "Mobile Devices" }) ,[device])+0>=2, 1, 0)
Would you explain why [device ]+0>=2, at the end does ?
- schoden6 years ago
Post Partisan
Hi I used the first formual with opportunity ID which is same for the category of device and Accesssories, It returned the correct list but picked up some opportunity ID with just devices also still.
- schoden5 years ago
Post Partisan
Hi All,
I am posting for others reference as the issue with AND operator is if it is to compare two different columns it works fine but when is to compare two values from same column the AND operator or IN operator doesnt work.
In such case you have to use nested IF.
Cheers.