Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following expression for getting top 5 rank number of customers by Amount. How I can modify this expression for getting rank and customer name?
=
aggr(if(Rank(total Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts))<=5
,
Rank(Total Aggr(Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts), Customer2,Country),'-')),Customer2,Country)
Now it looks like: 1,2,3,4,5
Should be: 1 - AAA, 2 - BBB, 3 - CCC, 4 - DDD, 5 - EEE
OK, I found the way:
=aggr(if(Rank(total Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts))<=5
,
Rank(Total Aggr(Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts), Customer2))),Customer2)
& ' - ' & aggr(if(rank(Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts))<=5,Customer2),Customer2)
OK, I found the way:
=aggr(if(Rank(total Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts))<=5
,
Rank(Total Aggr(Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts), Customer2))),Customer2)
& ' - ' & aggr(if(rank(Sum({$<Account={[REVENUE - Total Revenue]},$(v_Period)>} Amounts))<=5,Customer2),Customer2)