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;
Almost
Where NewField='Passed';
Hi,
Please find the corrected script. Hope that helps
FirstTable:
Load [field1],
[field2],
[field3],
If (([field3]='Yes' and [field2]='No'), 'Passed', 'Not Passed') as NewField
FROM
MyFileLocation;
NewTable:
Load *
Resident FirstTable
Where NewField='Passed';
Drop Table FirstTable;
Regards
Krishnapriya
Sorry I copied incorrectly, I have it like that Where NewField='Yes'; but it does not work
Yeah, I misread the script. Corrected now.
I have it like this but again I get empty.. not sure what the problem is....
Please share sample data, so that it will be easy for us to trouble shoot and get you an answer...
Can you share the data in excel or share the qvw.
hi
Try this.............
Error Is in this :If ([field3]='Yes' and [field2]='No'), 'Passed', 'Not Passed') as NewField
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;
-Nagarjun
you can use above script,
It will work.error in your script is there is one extra bracket after " [field2]='No' " this.
check and revert back
_nagarjun