Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HEy,
I want to show top 3 salesperson according to sales in a TEXTBOX. I have used following code but it does not work. Noyhing is being shown. Can anyone tell me how to show names of top 3 salesperson in a TEXT-BOX.
=concat(distinct IF(aggr(rank(sum(Sales)),Salesperson)<=3,Salesperson&CHR(13)))
Thanx
Hi Nikhil,
Try to create 3 variable for identifying the 3 sale persons and combine the same in text box.
Your expression works for me. The only thing that might be an issue are nulls in Sales. Try using RangeSum() instead of sum() in your aggregation.
Hy it still not showing anything with rangesum(). What to do ?? Is there any option that i have to check to show the value in textbox ?
Hi Nikhil,
Can you please post your app.
Last thing: Try the following expression:
=concat(distinct IF(aggr(rank(sum(Sales),0,1),Salesperson)<=3,Salesperson&CHR(13)))
If that does not work try the below:
Validate your expression step by step:
1. Create a straight table with Salesperson as dimension and 2 expressions
a) sum(Sales)
b) rank(sum(Sales))
Check if sum(Sales) is properly calculated (has values) and has been correctly ranked.
2. Add a new third expression
c) if(rank(sum(sales)) <=3, Salesperson)
Check if you correctly see only your top 3 Salesperson.
If 1 & 2 are working well, your expression should work fine.
Thanks,
It works now
nikhil, if any of our answers in this post has helped your or answered your question please mark it as such to help others having similar issues.
Try the following expression:
=concat(distinct IF(aggr(rank(sum(Sales),0,1),Salesperson)<=3,Salesperson&CHR(13)))
Try this
Sales man Name for 1st
= Only(if( Aggr( rank( (sum({<Year= {$(=Max(Year))},MonthID={$(=Max(MonthID))}, Month,Year=,Quarter=>}Sales)
)),SalesMan)=1,SalesMan))
Sales man name for 2nd
= Only(if( Aggr( rank( (sum({<Year= {$(=Max(Year))},MonthID={$(=Max(MonthID))}, Month,Year=,Quarter=>}Sales)
)),SalesMan)=2,SalesMan))
Salesman Name for 3rd
= Only(if( Aggr( rank( (sum({<Year= {$(=Max(Year))},MonthID={$(=Max(MonthID))}, Month,Year=,Quarter=>}Sales)
)),SalesMan)=3,SalesMan))