
Re: Count Distinct, Multiple Measures (Sum)?
Sunny Talwar Jun 15, 2016 6:11 AM (in response to Sam Maile)How exactly did you add Product_2 and Product_3?

Re: Count Distinct, Multiple Measures (Sum)?
Sam Maile Jun 15, 2016 6:30 AM (in response to Sunny Talwar )In SQL I added them like so:
select count(distinct ID) as Number
from table1 x
where ( X.Product_1 + X.Product_2 + X.Product_3 ) > 0 and
X.Year = '2016/05'
However, in set analysis I am not too sure how.
I added them like:
Count({$<PRODUCT_1+={">0"},PRODUCT_2+={">$(>0)"},PRODUCT_3+={">$(>0)"}>} DISTINCT ID)
Which is wrong. As all three need to be greater than 0 to be distinct.This IF statement works accordingly, however set analysis will be needed due to the volume of the data:
count (DISTINCT if((PRODUCT_1+ PRODUCT_2 + PRODUCT_2)>0, ID))
Thanks.

Re: Count Distinct, Multiple Measures (Sum)?
Sunny Talwar Jun 15, 2016 6:52 AM (in response to Sam Maile)May be try this:
Count({$<ID = {"=PRODUCT_1 > 0 and PRODUCT_2 > 0 and PRODUCT_3 > 0"}>} DISTINCT ID)

Re: Count Distinct, Multiple Measures (Sum)?
Sam Maile Jun 15, 2016 7:00 AM (in response to Sunny Talwar )Hi Sunny,
I have tried this already. Sadly, it's not showing the correct figure
Re: Count Distinct, Multiple Measures (Sum)?
Sunny Talwar Jun 15, 2016 7:14 AM (in response to Sam Maile)Is ID and Product coming from different tables?

Re: Count Distinct, Multiple Measures (Sum)?
Sam Maile Jun 15, 2016 7:20 AM (in response to Sunny Talwar )Hi Sunny,
No these are all on the same table.
Re: Count Distinct, Multiple Measures (Sum)?
Sunny Talwar Jun 15, 2016 7:25 AM (in response to Sam Maile)Would you be able to create a straight table with ID as dimension and the following expression:
Sum(Aggr(If(PRODUCT_1 > 0 and PRODUCT_2 > 0 and PRODUCT_3 > 0, 1, 0), ID))
What do you get for the total is not the correct number you are looking to get?





Re: Count Distinct, Multiple Measures (Sum)?
Sasidhar Parupudi Jun 15, 2016 8:22 AM (in response to Sam Maile)Count({$<ID = {"=(PRODUCT_1 + PRODUCT_2 +PRODUCT_3) > 0"}>} DISTINCT ID)



Re: Count Distinct, Multiple Measures (Sum)?
Sebastian Pereira Jun 15, 2016 7:31 AM (in response to Sam Maile)Hi, try
COUNT ({< ID=P({<Product_1={">0"}>}) + P({<Product_2={">0"}>}) + P({<Product_3={">0"}>}) >} DISTINCT ID)

Re: Count Distinct, Multiple Measures (Sum)?
Sebastian Pereira Jun 15, 2016 7:34 AM (in response to Sebastian Pereira )If you want to use Set Analysis use
COUNT ({< ID=P({<Product_1={">0"}>}) + P({<Product_2={">0"}>}) + P({<Product_3={">0"}>}) >} DISTINCT ID)

Re: Count Distinct, Multiple Measures (Sum)?
Sam Maile Jun 15, 2016 8:14 AM (in response to Sebastian Pereira )Thanks, this was the correct one.
