1 Reply Latest reply: Apr 10, 2017 4:59 PM by Sarah Sullivan RSS

    Adding Data Fields - Data Load Editor

    Adam Ante

      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

        • Re: Adding Data Fields - Data Load Editor
          Sarah Sullivan

          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.