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

Derive additional column on existing table during Load

Hi!

Is there a way I can derive an additional field on existing table during the LOAD?

Sample Output:

   

IDStatusFinal Status
AbcpassPassed
Defpass (with special cases)Passed
GhifailFailed

Final Status column will be my additional/derive field based on the initial Status field on my existing table.

Appreciate your help.

-Bea

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

You can do a load from an existing table using resident, if you want add (join) the column to the existing table use a join load. Something like:

Join (SourceData) LOAD

ID,

If(left(Status,4)='pass','Passed',If(left(Status,4)='fail','Failed')) as [Final Status]

Resident SourceData;

View solution in original post

3 Replies
stigchel
Partner - Master
Partner - Master

You can do a load from an existing table using resident, if you want add (join) the column to the existing table use a join load. Something like:

Join (SourceData) LOAD

ID,

If(left(Status,4)='pass','Passed',If(left(Status,4)='fail','Failed')) as [Final Status]

Resident SourceData;

Ralf-Narfeldt
Employee
Employee

Add a preceding load that adds the Final Status:

Load *, If(left(Status,4) = 'fail', 'Failed', 'Passed') As [Final Status];

Load * inline [

ID,Status

Abc,pass

Def,pass (with special cases)

Ghi,fail];

This is based on your input data, if you have more possible values, you may need to adjust the If condition.

Not applicable
Author

Works perfectly! Thanks!