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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Edit Script, If Field A = Field B

Hi Guys,

I have two fields coming in from my Load Script

ASSIGNED_TO and a COMPLETE_BY

Is it possible to add another field to the script based on the two fields above that if ASSIGNED_TO = COMPLETE_BY then it creates a Field called MASTER_USER?

13 Replies
Anonymous
Not applicable
Author

Hi Colin,

in fact, if your ASSIGNED_TO field is the actual ID, it should work. So, are you having any problems after using this expression?

I mean that it should be enough, let me know it if it doesn't work.

Colin-Albert
Partner - Champion
Partner - Champion

This logic should work for you.

if(len(trim(ASSIGNED_TO)) = 0, 'OPEN',        // tests for blank and nulls

     if( ASSIGNED_TO = COMPLETE_BY , COMPLETE_BY, 'NONE')) AS MASTER_USER

Anonymous
Not applicable
Author

Hi Colin,

Thanks for this, it is very close.

If I just wanted to merge the IDs in ASSIGNED_TO and COMPLETE_BY to create the new field MASTER USER. How would that work in the script?

Colin-Albert
Partner - Champion
Partner - Champion

You can drop the fields at the end of the script.

drop field ASSIGNED_TO ;