Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
sunil-kumar5
Creator II
Creator II

How to get Top State Name and Value in KPI card

Hi Community,

I want to show Top state name who made highest sale in current year which is till date. I mean to say the KPI card should present like [Chennai 125K]. Also it would be calculated based on count distinct sales id as there will be duplicates.

Sales IDState Name
10001Delhi
10002Maharastra
10003Chennai
10004Delhi
10005Maharastra
10006Chennai
10007Delhi
10008Maharastra
10009Chennai
10010Delhi
10011Maharastra
10012Chennai
10013Delhi
10014Maharastra
10015Chennai

 

Please advise.

Thanks

1 Solution

Accepted Solutions
Steven_Haught
Creator III
Creator III

Or if needing the sum of sales for the region to control the name:

=FirstSortedValue(StateName &' ' &Aggr(Sum(Sales), StateName), -Aggr(Sum(Sales), StateName))

View solution in original post

3 Replies
Steven_Haught
Creator III
Creator III

You could try this as measure in KPI, 

FirstSortedValue(StateName &' ' & Sales , -Sales)

Steven_Haught
Creator III
Creator III

Or if needing the sum of sales for the region to control the name:

=FirstSortedValue(StateName &' ' &Aggr(Sum(Sales), StateName), -Aggr(Sum(Sales), StateName))

sunil-kumar5
Creator II
Creator II
Author

Solved!! Thanks for your help Steven:-)