Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Adding Data Fields - Data Load Editor

Hello, I'm new to Qlik Sense and I'm trying to create new data fields via the Data Load Editor.

Below is the auto script:

LOAD 

    CustomerID,

    SubCustomerID,

FROM [FILEPATH.qvd]

(qvd);

In some cases the CustomerID is blank, so I would like to create a new field MyCustomerID, which would equal the CustomerID where it exists and the SubCustomerID where CustomerID is null.  Feels easy, but I'm new to this language.

Thanks,

Adam

1 Reply
sarahplymale
Creator
Creator

Try something like this using the len function to find empty CustomerID fields. 

LOAD

    CustomerID,

    SubCustomerID,

     if(len(CustomerID) =0, SubCustomerID, CustomerID) as MyCustomerID

FROM [FILEPATH.qvd]

(qvd);

You could also use the isnull function depending on how the empty fields are valued.