Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have two tables:
1. sec_master and
2. security_classification
They are combined using outer join and using security_id (key)
Now, to the resulting table sec_master, I need to specify that;
If instrument_type is CRNY, CD, or VRDN
then industry_lvel1_desc = CASH
else industry_lvel1_desc = industry_lvel1_desc
For some reason I am getting an error. Following is the script and error log.
sec_master:
LOAD security_id,
instrument_type
FROM
(qvd);
OUTER join LOAD
security_id,
industry_level1_desc as MSCI_industry_level1_desc
FROM
(qvd);
NOCONCATENATE LOAD *,
If(Match(instrument_type,'CRNY','CD','INVTFRE','INVTFRET','INVTXRE','INVTXRET','STIF','TECP','VRDN'),'CASH', industry_level1_desc)
RESIDENT sec_master;
DROP TABLE sec_master;
Error Message:
Any suggestion how to fix this?
Thanks
Looks like industry_level1_desc was renamed to MSCI_industry_level1_desc earlier :
OUTER join LOAD
security_id,
industry_level1_desc as MSCI_industry_level1_desc
FROM
(qvd);
Hi Bill
Good point. After applying following change the syntax error is eliminated, However the logic is still not implemented the way it is intended.
sec_master:
LOAD security_id,
instrument_type
FROM
(qvd);
UTER join LOAD
security_id,
industry_level1_desc as MSCI_industry_level1_desc
FROM
(qvd) ;
NOCONCATENATE LOAD *,
If(Match(instrument_type,'CRNY','CD','INVTFRE','INVTFRET','INVTXRE','INVTXRET','STIF','TECP','VRDN'), 'CASH', MSCI_industry_level1_desc) as MSCI_industry_level1_desc_L1
RESIDENT sec_master;
DROP TABLE sec_master;
The code is working if I create a separate attribute and call it for example MSCI_industry_level1_desc_L1.
The intended out put is to overwriting the attribute MSCI_industry_level1_desc which is not working.
for example, it doesn't work if I use the line
if(Match(instrument_type,'CRNY','CD','INVTFRE','INVTFRET','INVTXRE','INVTXRET','STIF','TECP','VRDN'), 'CASH', MSCI_industry_level1_desc)
INSTEAD OF THE LINE
If(Match(instrument_type,'CRNY','CD','INVTFRE','INVTFRET','INVTXRE','INVTXRET','STIF','TECP','VRDN'), 'CASH', MSCI_industry_level1_desc) as MSCI_industry_level1_desc_L1
How to overwrite the attribute MSCI_industry_level1_desc?