Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am loading a table and deriving a new column during the load. Then I want to create a new table where the new column is 'Passed', and just load those records, have them in the new table and drop the first table. Is below correct? For some reason when I run this, I get all empty, and NewTable does not appear.
FirstTable:
Load [field1],
[field2],
[field3],
If (([field3]='Yes' and [field2]='No'), 'Passed', 'Not Passed') as NewField
FROM
MyFileLocation;
NewTable:
Load *
Resident FirstTable
Where NewField='Y';
Drop Table FirstTable;
I think you missed the NoConcatenate...
FirstTable:
Load [field1],
[field2],
[field3],
If (([field3]='Yes' and [field2]='No'), 'Passed', 'Not Passed') as NewField
FROM
MyFileLocation;
NewTable:
NoConcatenate
Load *
Resident FirstTable
Where NewField='Y';
Drop Table FirstTable;
Without NoConcatenate, your NewTable won't be created because it has the same fields as FirstTable. So add that and you should be fine
Sunny,
Where clause is also wrong. It should be either 'Passed' or 'Not Passed'.
Where NewField='Y';
Where NewField='Passed';