4 Replies Latest reply on Jul 14, 2016 10:52 AM by Sudheesh Rao

# Finding Unique Values

Hi all,

Not sure if this has been covered anywhere but I am looking for solution to the problem I am facing.

I have a table with Order ID and Product name. I want to compute a value in col C 'True' when the order ID has only Product 'A'.

 Col A Col b Col C Order ID Product Name True/False 1234 A FALSE 1234 B FALSE 1234 A FALSE 1234 D FALSE 1125 A TRUE 1147 B FALSE 1589 A TRUE 1589 A TRUE 1892 A TRUE

Regards.

Sudheesh Rao

Jonathan Drummey

• ###### 1. Re: Finding Unique Values

Create a conditional Set on Order ID that has the formula:

SUM(IF [Product Name] = 'A' THEN 1 ELSE 0 END) > 0

The Set will return a boolean IN/OUT and can be used as a Column C, a dimension, in calculations, etc.

Jonathan

• ###### 2. Re: Finding Unique Values

But this will assign 'In' value to, in this case, for Order ID 1234 which I don't want. The product mix for any id should only be Product A. If it has other products then it should assign out.

Regards,

Sudheesh Rao

• ###### 3. Re: Finding Unique Values

You can still use a Set, there are a variety of ways of writing this. Assuming that Product Name is never Null, this will work:

MIN([Product Name]) = 'A' AND MAX([Product Name]) = 'A'

Jonathan

1 of 1 people found this helpful
• ###### 4. Re: Finding Unique Values

Oh you are a genius ! Thanks a ton. It worked