Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
say I have the follwing table:
| Country | #Customers |
|---|---|
| US | 560 |
| UK | 50 |
| DK | 3 |
| IL | 45 |
| Total | 658 |
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
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
Check the attached qvw.
Hope this helps
Fernando
wow that was fast. stil i miss the expression that points out the country name = "US"
HI
Try like this
1.Sum({<Country={'US'}>} #Customers)
2.Sum({<Country={'US'}>} #Customers)/Sum(total #Customers)
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
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
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 %')
This is it. THANKS!!!!!