Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top Sales Person for a given city

Hello,
I am new to Qlikview and was trying to figure out how to get the top sales person for a given city.  For Example:
Atlanta:  John Doe
Charlotte: John Doe
Birmingham: John Doe
Tampa: Bill Jones
Miami:  Bill Jones
Newark: Todd Smith
Orlando: Todd Smith
Based on some searches on the community forums, I built the following function:
only({<SalesPerson= {"=rank(sum(LineSalesAmount),City,SalesPerson) =1"}>} SalesPerson )
This yields the following results:
Atlanta:  John Doe
Charlotte: John Doe
Birmingham: John Doe
Tampa: <blank>
Miami: <blank>
Newark:<blank>
Orlando: <blank>
What am I missing?  Any help is always appreciated.
Regards,
Joe
1 Reply
Not applicable
Author

Use FirstSortedValue

Create a chart with

Dimension : City

Expression for top sales person :   FirstSortedValue(  Person , - Sum(Sales)  )

I use -Sum(Sales) to get the first 

JJ