Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
n1ef5ng1
Creator
Creator

Mapping table with an added twist

Hi everyone,

 

I have a question on mapping.

Lets say i have a mapping table for marketing team where they can create conditions for the campaign that they are doing. In this way all the orders in QlikSense will be tagged to a campaign if applicable to track marketing performance.

ConcatBooking_WeekCountryProductCampaign_ID
2018-01BrazilEggs2018-01BrazilEggs1
2018-02ArgentinaBread2018-02ArgentinaBread2
2018-02ArgentinaEggs2018-02ArgentinaEggs2
2018-03Malaysia2018-03Malaysia 3

 

 

If u see the fourth record, it is a campaign for Malaysia where it applies to all product. Hence the composite Key (is Booking Week&Country&Product) will be blank for products in the case for Malaysia.

There are multiple permutations into it where there can be cases where country field are empty (which applicable all countries) and for certain product like bread.

 

Hence to list out all permutation in my QS code is not possible due to the complexity.

 

In my table , i added this code .

 

applymap('Test',Booking_Week & Country & Product ,false()) to get the campaign ID. How can i ask QS to smartly interpret those blank value and take in all the values? meaning for the case (Malaysia), it will take all products for Country = Malaysia.

1 Solution

Accepted Solutions
sunny_talwar

May be create multiple Mapping tables with map based on different Concat

MappingTable1:
Mapping
LOAD Booking_Week&Country&Product,
Campaign_ID
FROM ...;

MappingTable2:
Mapping
LOAD Booking_Week&Country,
Campaign_ID
FROM ...;

and then when you are using it you can do something like this

ApplyMap('MappingTable1', ....., ApplyMap('MappingTable2', ....., Null())) as ....

So, basically try to map based on MappingTable1... but for Malaysia it won't work.. and will go into the second ApplyMap based on MappingTable2.

 

View solution in original post

1 Reply
sunny_talwar

May be create multiple Mapping tables with map based on different Concat

MappingTable1:
Mapping
LOAD Booking_Week&Country&Product,
Campaign_ID
FROM ...;

MappingTable2:
Mapping
LOAD Booking_Week&Country,
Campaign_ID
FROM ...;

and then when you are using it you can do something like this

ApplyMap('MappingTable1', ....., ApplyMap('MappingTable2', ....., Null())) as ....

So, basically try to map based on MappingTable1... but for Malaysia it won't work.. and will go into the second ApplyMap based on MappingTable2.