Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a chart with date as dimension, and in expression, I want to display the rank of a customer (e.g. X) in terms of the number of orders placed. The end result should look like this chart:
| Date | Total orders | Orders from X | Order rank of X |
| 10/08/2016 | 21 | 5 | 2 |
where Total orders: count(distinct Id)
How can I display this?
My bad, I put Order by mistake in the Aggr() function, I wanted to do this;
Only({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Date))
May be like this:
Only({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Order))
Hi stalwar1, I tried this:
Only({<Customer={'X'}>}Aggr(Rank(Count(DISTINCT Id)),Customer, Id)) but getting values like "1-31". Any ideas? Thanks.
Is there a reason you did not add Date in the Aggr() function?
That worked! Cheers.
Only({<Customer={'X'}>}Aggr(Rank(Count(DISTINCT Id)),Customer, OrderDate))
My bad, I put Order by mistake in the Aggr() function, I wanted to do this;
Only({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Date))
Hi stalwar1, what if there is more than 1 ranking, like "4-5"? Only() returns a null for these ranks I think.
How about Concat?
Concat({<Customer = {'X'}>}Aggr(Rank(Count({1}DISTINCT Id), Customer, Date), ', ')