Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
yes laura, you can use applymap for any DB or Tables
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?
It is possible to use applymap in your case. Will you post some sample data?
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
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.
thanks
Arjun,
do you have any examples where tables are used as i am receiving a syntax error?
Regards,
Laura
so silly. i entered the Applymap into the select script instead of the load ! Doh!