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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping 3 unrelated field values

Hi,

I would like to map 3 unrelated field values to a new field.

In more detail:

I have the fields:

1) WebSite

2) Language

3) CustomersCountry

I want to create a new field based on the values of these fields. The following table has an example logic:

WebSite
Language
CustomersCountryNewField
site1.ru(any value)(any value)Russia
site2.ru(any value)(any value)Bulgaria
site3.ru(any value)(any value)Ukraine
anothersite.ro(any value)(any value)Romania
home24.comRussia(any value)Russia
home24.comRomania(any value)Romania
home24.comBulgaria(any value)Bulgaria
travel.gr(any value)CyprusCyprus
travel.gr(any value)GreeceGreece

'

e.t.c.

What is the best way to do that?

Thanks in advance

Panayotis

3 Replies
jvitantonio
Specialist III
Specialist III

Hi, can you explain how you map for example the first row to "Russia"?

Not applicable
Author

Exactly as the table example given above.

> When "WebSite" is "site1.ru" and for any value of "Language" and for any value of "CustomersCountry" field "NewField" has to have the value "Russia".

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Just use a composite key (concatenation of website, language, customer country and map that to NewField.

mapfield:

mapping load

     Website & Language & CustomerCountry,

     NewField

FROM ....;

Then use apply map like:

LOAD ...

     ...

     applymap('mapfield',  Website & Language & CustomerCountry) As NewField

     ...

FROM ...

You could also use a join rather than a map for this sort of issue.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein