Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following scenario:
one Customer table and one Sales table; linked together in the model by Customer_ID, let's say
I need to create a pie chart that count the # of Customers over a dimension with these segments:
- No Sales
- with Sales
The expression is simple: count(distinct Customer_ID)
The issue is that the calculated dimension and the expression doesn't return anything for "No Sales" so the pie chart only display the # of Customers with Sales.
Is it possible to solve it without any joins in the model?
Regards,
Mihai
Please try with a dimensionless pie chart adn 2 expressions
Exp1: count(distinct {<Customer_ID={"=Sum(Sales)=0"}>}Customer_ID)
Exp2: count(distinct {<Customer_ID={"=Sum(Sales)>0"}>}Customer_ID)
I´m assuming that your metric field is called "Sales"
Please try with a dimensionless pie chart adn 2 expressions
Exp1: count(distinct {<Customer_ID={"=Sum(Sales)=0"}>}Customer_ID)
Exp2: count(distinct {<Customer_ID={"=Sum(Sales)>0"}>}Customer_ID)
I´m assuming that your metric field is called "Sales"
what is calculated dimension?
I've try it and didn't get the expected result. I will add some more details: Cust: load * Inline [ Cust_Id, Name 1,A 2,B 3,C 4,D ]; Sales: load * Inline [ Cust_id, Sales 1,100 2,20 3,30 ] The pie chart should count 3 customers with sales and 1 customer without sales. Regards, Mihai
It seems correct to me
PFA
Yes!
Thank you, Anjos!
Could you explain please the logic inside the set analysis? I never used such.
Set Analysis is equivalent to a selection made into a listbox
count(distinct {<Customer_ID={"=Sum(Sales)=0"}>}Customer_ID) means
Make a selection into Customer_ID field retrieving all customers that have Sum(Sales)=0, meaning "NO SALES" at all
count(distinct {<Customer_ID={"=Sum(Sales)>0"}>}Customer_ID) means
Make a selection into Customer_ID field retrieving all customers that have Sum(Sales)>0, meaning this customer have had sales