Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Sum({<Country={'Japan','UKI','AFR','Ireland'}>}Sales)
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
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)
Sum({<Country={'Japan','UKI','AFR','Ireland'}>}Sales)
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
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 ??
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)
Thanks Vegar
Never hardcoded the country names. Either create a variable or create a flag as vegar suggested.