Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

How to show text values in a text box??

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

9 Replies
avinashelite

Hi Nikhil,

Try to create 3 variable for identifying the 3 sale persons and combine the same in text box.

simondachstr
Luminary Alumni
Luminary Alumni

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.

nikhilgarg
Specialist II
Specialist II
Author

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 ?

avinashelite

Hi Nikhil,

Can you please post your app.

simondachstr
Luminary Alumni
Luminary Alumni

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.

nikhilgarg
Specialist II
Specialist II
Author

Thanks,

It works now

simondachstr
Luminary Alumni
Luminary Alumni

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.

richard_pearce6
Luminary Alumni
Luminary Alumni

Try the following expression:

=concat(distinct IF(aggr(rank(sum(Sales),0,1),Salesperson)<=3,Salesperson&CHR(13)))

stephenedberkg
Creator II
Creator II

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))