Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Consider 2 fields, Field 1 and Field 2.
Field 2 is in Date format.
Logic to populate Field 2 :
if Isnull(Field 1) then 'NA' else Field 2 as Field 2
Here the value NA is not populating since the value Field 2 is in date format and 'NA' is text.
I tried with Text(Field 2), Text(Date(Field 2'MM/DD.YYYY')) etc...
Still 'NA' is not coming.
Thanks,
Neetha
Hi Neetha,
This code worked just fine for me:
load *,
if(isNull(Field1),Text(Field2),'NA') as Field3;
load if(len(Field1)>0,Field1,Null()) as Field1,
Date#(Field2,'DD/MM/YYYY') as Field2;
load * Inline
[
Field1,Field2
,01/01/2018
Test,02/04/2018
];
As you can see, the Field2 is a numeric field, due to it being aligned to the right and Field3 is a text field, since its aligned to the left.