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: 
Anonymous
Not applicable

ApplyMap question

can I use ApplyMap when there is only "1" common id between two db tables (no excel files)?

 

Table A (the facts table):

  Contract_ID

 

 

Table B (table I am retrieving from):

  Contract_ID, Faults

 

 

I want to retrieve the record "if Faults = 't' in table B.   Can I do this or do I need to use Joins for this?

I have tried the following but it keeps looking for a file rather that recognising the tables. 

 

 

Mapping table as follows:-

AtFault_MappingTable:

 

Mapping LOAD

 

          training_contract_id,

 

          [at_fault]

 

from training_contract_returns

 

where at_fault = 't';

 

 

Load -

AtFault:

 

LOAD training_contract_id,

 

           at_fault,

 

           ApplyMap('AtFault_MappingTable',training_contract_id,'Nofault') as [AtFaultContractReturns]

 

from training_contract_returns;

15 Replies
qlikviewwizard
Master II
Master II

Glad to hear this. Please mark Correct Answer and Helpful to close the thread.

Regards,

Arjun

avinashelite

you can also try with the exist function too

shair_abbas
Partner - Creator
Partner - Creator

hey.
I have a simple question.
What is the reason of using mapping while you can get the desire results by just using joins?

avinashelite

when you have small amount of data their is not much difference between join and applymap but when you have huge data it has lot of impact with the performance . for eg say you need 3 to 4 columns from table 2 in table 1 , where table 1 have around 1 millions of records . In this case join is not ideal to use because it had huge impact on memory insted you can use the apply map 

avinashelite

check this thread

Joins Vs Applymap

shair_abbas
Partner - Creator
Partner - Creator

As you say if you need 3 to 4 columns from table 2 in table1 then you have to create 3 to 4 mapping load because in mapping load you just have two value one for look up other is return value.
so if same table is loaded 4 time and  searching in same table 4 time this will really harm the performance.

Although this is my opinion.
hope you find it helpful.

regards;

Syed Shair Abbas