Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Black_Hole
Creator II
Creator II

Filter country EU or OUT EU

Hello all,

I would like to create a list box with two "vectors" : european countries and others.

Each vector contain the iso code for example:

             - for the vector "european country" , the values are 'ES', 'IT', 'FR' , etc.

             - for the vector "others" , the values are 'US', 'JP', etc.

This list box is linked with my customer table.

My purpose is to show all the customer according to my selection in the list box (i.e. european countries or others).

Please could you help me to create this list box.

 

I hope that my request is clear. If not, please do not hesitate to tell me to clarify.

Thank you in advance for your help.

 

Labels (4)
1 Solution

Accepted Solutions
Black_Hole
Creator II
Creator II
Author

Hello all, 

I finally resolved this request using the expression below:

if(match(COUNTRY'AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT','LV', 'LT', 'LU', 'MT','NL','PL','PT','RO','SK','SI','ES','SE','GB'),'EURO','NON-EURO')

Have a nice day.

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

not 100% clear. If i understand you correctly you want a filter to select 'eurpean countries' or 'others'

i would say create a new column in you datamodel using below steps

 

VectorEuroMap:
//mark all european countries
Mapping load inline [

Country, Vector

ES, Europe

FR, Europe


];

load
*
, applymap('VectorEuroMap', Country,'Other')

from yourdata;

 

 

Black_Hole
Creator II
Creator II
Author

Hi @dplr-rn ,

Thank you for your help. I try your solution but unsuccessful in my case.

So, I suggest another solution...

For example, I try the solution below but there is an error message when I run the script.

LOAD COUNTRY as "EU_COUNTRY"
FROM CUSTOMER_TABLE
WHERE match(COUNTRY , 'FR','ES');

Please could you tell me what is wrong in my request above. 

Thank you in advance for your help.

Black_Hole
Creator II
Creator II
Author

Hello all, 

I finally resolved this request using the expression below:

if(match(COUNTRY'AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT','LV', 'LT', 'LU', 'MT','NL','PL','PT','RO','SK','SI','ES','SE','GB'),'EURO','NON-EURO')

Have a nice day.