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: 
Not applicable

ApplyMapping using values in two fields?

How can I use values from two fields in the mapping, (that is if the value from a field meets a certain criteria then it should pick the value from another field)

In the SQL statement it would look like this:

CASE when WWHS = "IT' then LLOC ELSE WWHS END

(where WWHS was the warehouse field and if the warehouse was 'IT" then it would be substituted with a value in the Location field)

6 Replies
nagaiank
Specialist III
Specialist III

You may use the following script:

If(WWHS = "IT', LLOC, WWHS) as newWWHS

Not applicable
Author

Hi Krishnamoorthy:

Thanks for your reply, what would happen in cases there are like 10 or more values to be used (like in my example instead of just IT if I need to use CT, RT, LT,XT and s on) the if statements become too much nested and was looking for a more neater way

Not applicable
Author

Hi Krishnamoorthy:

Thanks for your reply, what would happen in cases there are like 10 or more values to be used (like in my example instead of just IT if I need to use CT, RT, LT,XT and s on) the if statements become too much nested and was looking for a more neater way

nagaiank
Specialist III
Specialist III

Use

If(Match(WWHS,'IT','CT','RT','LT','XT')=1, LLOC, WWHS) as newWWHS

Not applicable
Author

HI Krishnamoorthy:

Thanks for your responce, I used the formulae as

if(match(WWHS,'IT','CT','RT','LT','XT')<>0,LLOC,WWHS) and it worked

thanks

Not applicable
Author

HI Krishnamoorthy:

Thanks for your responce, I used the formulae as

if(match(WWHS,'IT','CT','RT','LT','XT')<>0,LLOC,WWHS) and it worked

thanks