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

Lookup Functionality in tMap Component

Hi,
Does anyone tried lookup function with multiple condition in tMap?

Input ------ tMap ------ Output
                   |
            Lookup Input
Scenario is I have 1 field in the Input and 3 fields in the Lookup. The condition should be:
~ if input field is equal to first field in Lookup, output the third field
~ else if input field is equal to second field in Lookup, output the third field
~ else, output null
Basically, I want to have OR operation inside the tMap. If anyone knows how to do this, I gladly appreciate it. Thanks in advance.

Example:

Input Data
  field1   |
|      A     |
|      B     |
|      C     |
|      D     |


Lookup Data
|   colA   |   colB   |   colC    |
|     A     |    B     | output1 |
|     E     |    G     | output2 |
|     D     |    A     | output3 |
|     F     |    C     | output4 |

Expected Output
field1   |   colC     
   A      | output1
   B      | output1
   C      | output4
   D      | output3

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi 

No OR logic on the lookup feature, you need to do the join two times for each filed, and then merge the result. eg:
input1--main--Map--out1--tHashOutput1
                      |
                 lookup(colA)
 |
onsubjobok
  |
input1--main--Map--out1--tHashOutput2
                      |
                 lookup(colB)
  |
onsubjobok
  |
tHashInput1--main--map--out1....
                              |
                          lookup
                              |
                         thashInput2

thashInput1: read data from thashOutput1
thashInput2: read data from thashOutput2

Regards
Shong