Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I created a CSV file from Script where I get something like:
Account,Zone,Date
01,A,05/07/2014
02,A,08/10/2014
03,,03/07/2014
As you can see, I have some empty values without Zones, like Account 03.
Then I load this file as a table and I get an Empty/Blank value for some Zones.
Is there any way to convert those blank into null or something else? How can I do?
Thank you!!!
maybe (replace inline load with your real file)
file:
load * inline [
Account,Zone,Date
01,A,05/07/2014
02,A,08/10/2014
03,,03/07/2014
]
;
table:
noconcatenate
load
Account,
if(len(trim(Zone))=0, 'zone is empty', Zone) as Zone,
Date
resident file;
drop table file;
Update now check please
You can add null values in the blank values see the example load
tmp:
LOAD * Inline
[
Account,Zone,Date
01,A,05/07/2014
02,A,08/10/2014
03,,03/07/2014
];
NoConcatenate
Final:
LOAD
Account,if(Len(Zone) = 0, Null(),Zone) as Zone,Date
Resident tmp;
DROP Table tmp;
Try near the top of the script:
Set NullInterpret = '';