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;

1 Solution
15 Replies
Anonymous
Not applicable
Author

yes laura, you can use applymap for any DB or Tables

evan_kurowski
Specialist
Specialist

Laura Castagna wrote: 

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. 

 

Often when you feel certain you have defined all the tables in the data model, yet the script still says tables are missing, the issue is the unintentional auto-concatenation of one table into another.

When you comment out all ApplyMap portions of your code, and reload, do you see both Table A & Table B in the data model?

md_qlikview
Creator II
Creator II

It is possible to use applymap in your case. Will you post some sample data?

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Laura,

You can create composite key to match your ApplyMap to your table

If you can post sample file community will help with best answer

Anonymous
Not applicable
Author

Assuming you are trying to load from a database table then you need to add the SQL Select ?  Otherwise it'll think you are trying to load from a file.

Anonymous
Not applicable
Author

thanks

Anonymous
Not applicable
Author

Arjun,

do you have any examples where tables are used as i am receiving a syntax error?

Regards,

Laura

Anonymous
Not applicable
Author

so silly.  i entered the Applymap into the select script instead of the load ! Doh!