Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to create a table and Pie Chat and identify the "Customer" type based on below logic but not sure why it can not show properly.
=Aggr(if([Special Customer]=1 and um(Gross Profit)>=0, 'Special Customer Profitable',
if([Special Customer]=1 and sum(Gross Profit)<0, 'Special Customer Loss Making',
if([Special Customer]=0 and sum(Gross Profit)>=0, 'Profitable',
if([Special Customer]=0 and sum(Gross Profit)<0, 'Non-Special Customer Loss Making',null())))), [Customer])
I apply above formula on the table, not sure why there are many null in the tbla.
Table
Year | Month | Customer | Rev | Cos | Gross Profit | Quantity | Special Customer | My Aggr Function |
2019 | Oct | AAA | 500 | 400 | 100 | 100 | 0 | |
2019 | Oct | BBB | 300 | 600 | -300 | 200 | 1 | |
2019 | Nov | AAA | 600 | 300 | 300 | 500 | 0 |
For the Pie Chat, I apply the same formula as the dimension. For the measure, I use sum(Quantity). But it can not show correctly as well.
Anyone can help me on this issue.
By seeing the data it is not full-filling the condition of 4 expressions. Please validate individual and then try?