Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Most valuable dimension

Hi,

say I have the follwing table:

Country#Customers
US560
UK50
DK3
IL45
Total658

I'm looking for 2 expression:

1. point out the Country with the most customers (=US)

2. % of the total = 560 / 658 = 85%

Is this possible in Qlikview?

oh, preferably as chart expression...

Thanks!

Dror

Labels (1)
1 Solution

Accepted Solutions
flipside
Partner - Specialist II
Partner - Specialist II

This will give you the Country with most Customers based on selection. Just pair it with Fernando's solution.

=FirstSortedValue(Country,-aggr(sum(#Customers),Country))

flipside

View solution in original post

7 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Check the attached qvw.

Hope this helps

Fernando

Not applicable
Author

wow that was fast. stil i miss the expression that points out the country name = "US"

MayilVahanan

HI

Try like this

1.Sum({<Country={'US'}>} #Customers)

2.Sum({<Country={'US'}>} #Customers)/Sum(total #Customers)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks. but this is assuming i know infront that the US has the largest customer base. I'm looking for expression that can determine it for me

flipside
Partner - Specialist II
Partner - Specialist II

This will give you the Country with most Customers based on selection. Just pair it with Fernando's solution.

=FirstSortedValue(Country,-aggr(sum(#Customers),Country))

flipside

swuehl
Champion III
Champion III

If your data is like in Mayil's sample app, i.e. the number of Customers is already aggregated per Country in field #Customers, you can use

=FirstSortedValue( Country , -#Customers) & ' : ' & num( max(#Customers) / sum(#Customers),'00,00 %')

Not applicable
Author

This is it. THANKS!!!!!