Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to use the following if statements in my Load function and am getting the error "Field 'EManufSerialNo' not found". I need to rename my fields since they are the same as fields I have in another table so I have put "E" in front of all the ones that I need to distinguish from the fields in my other table. How can I use this if statement on this data?
Load
"User status" as EUserStatus,
"System status" as ESystemStatus,
Description as EDescription,
"Plant section",
"Functional Loc." as EFunctionalLoc.,
"Model number",
Manufacturer as EManufacturer,
"Valid From",
ManufSerialNo. as EManufSerialNo,
ConstructYear,
"TS created on",
"Start-up date",
"Main WorkCtr",
if(EManufSerialNo='',1,0)as BlankEManufSerialNo
FROM [lib://1C Metrics/Equipment Critical Data Fields.xlsx]
(ooxml, embedded labels, table is Sheet1);
I guess you need
if(ManufSerialNo='',1,0)as BlankEManufSerialNo
Edit: or better yet
if(len(trim(ManufSerialNo))=0,1,0) as BlankEManufSerialNo
Your rename of field is only valid for the output of your load, therefore you will need to use the original fieldname in your if-statement. I notice you got a dot in the ending of your field name. Try the following :
if(ManufSerialNo.='',1,0) as BlankEManufSerialNo