Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a variable 'Fund' in my Table1 and for any NULL values i would like it to match the document_number and document_date from Table1 with the Document_Number_Blank and Docuemnt_Date_Blank from mapping file and if it is a match then I would like to populate 'Fund' with the Fund_Blank from the MappingFile. I wrote the script below but continue to get an error saying it cant find Document_Number_Blank. Appreciate any help!
MappingFile:
Load
Document_Number_Blank,
Document_Date_Blank,
Fund_Blank
.....;
Table1:
Document_Number,
Document_Date,
If(Len(Trim(Fund))=0 or Isnull(Fund) and [Document_Number]=Document_Number_Blank and "Document Date" = Document_Date_Blank ,Fund_Blank, if(Len(Trim(Fund))=0 or Isnull(Fund),'Missing Fund', Fund)) as Fund
.....;
Maybe this will work for you.
MapFund:
MAPPING LOAD
Document_Date_Blank &'_'& Document_Number_Blank,
Fund_Blank
FROM...;
Table1:
LOAD
Document_Number,
Document_Date,
if(len(trim(Funds))>0, Funds, applymap ('MapFund', Document_Date &'_'& Document_Number,'Missing Fund') ...;
Maybe this will work for you.
MapFund:
MAPPING LOAD
Document_Date_Blank &'_'& Document_Number_Blank,
Fund_Blank
FROM...;
Table1:
LOAD
Document_Number,
Document_Date,
if(len(trim(Funds))>0, Funds, applymap ('MapFund', Document_Date &'_'& Document_Number,'Missing Fund') ...;
Works perfectly, thank you!