Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I use if statements in my Load when I've renamed fields?

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);

2 Replies
Anonymous
Not applicable
Author

I guess you need

    if(ManufSerialNo='',1,0)as BlankEManufSerialNo



Edit: or better yet

if(len(trim(ManufSerialNo))=0,1,0) as BlankEManufSerialNo

Vegar
MVP
MVP

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