Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
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
Not applicable

Re: Adding Data Fields - Data Load Editor

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.