Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Saiteja1
Contributor III
Contributor III

Sum of some particular countries using set analysis

Hi..,

I have a scenario

we have two fields

Country ,Sales
India, 1000
UK ,3000
Ireland ,5000
Japan ,2000
Japan ,9000
APAC ,2000
UKI ,3000
AFR ,7000
Uganda, 8000

I need sum of sales of Japan,UKI,AFR,Ireland using set analysis

Thanks in advance

Labels (1)
4 Replies
rwunderlich

Sum({<Country={'Japan','UKI','AFR','Ireland'}>}Sales)

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

Saiteja1
Contributor III
Contributor III
Author

Hi rwunderlick,

Thanks for your solution 

if we have 10 to 20 countries we can write like your solution but if we have more than 50 countries then ??

Vegar
MVP
MVP

If you have many countries you might consider creating a field/flag in the data model for grouping them together. Consider adding an Country dimension to your data model.

Country , inKpiCountry
India, No
UK , No 
Ireland ,Yes 
Japan ,Yes 
APAC ,No 
UKI ,Yes 
AFR ,Yes 
Uganda, No

Then use the following expression:

Sum({<inKpiCountry={'Yes'}>}Sales)

Saiteja1
Contributor III
Contributor III
Author

Thanks Vegar