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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
heitorcarlosgomes
Contributor II
Contributor II

Lookup with Multiple Criteria

Hey everyone,

I need to do a multiple lookup between two tables.

Let me show

Table1:

Data Fabricante Provedor
01/04/2023 Randon OEM
01/05/2023 Librelato IBERO
01/06/2023 Sergomel SUSPENSYS
... ... ...
01/11/2023 Librelato SUSPENSYS
01/12/2023 Sergomel IBERO

 

As we can see, Librelato and Sergomel changed their values. 

 

Table2:

Data Estado Município Fabricante Produto Total Provedor
01/04/2023 SC Itajaí Randon ... x Value needed
01/05/2023 SP São Paulo Librelato ... y Value needed
01/06/2023 SP São Paulo Sergomel ... z  Value needed
...     ... ...   Value needed
01/11/2023 MG Belo Horizonte Librelato ... w Value needed
01/12/2023 RS Porto Alegre Sergomel .... x Value needed

 

i need to do a lookup with two criteria  

 

 

 

Labels (1)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

You can create a mapping table with Table1 concatenating Data and Fabricante, something like this:
mapProvedor:
Load Text(Data)&'@'&Fabricante as Key, Provedor as Value Resident Table1;

Then when loading Table2, you can do:
...
ApplyMap('mapProvedor',Text(Data)&'@'&Fabricante) as Provedor
...

View solution in original post

2 Replies
vincent_ardiet_
Specialist
Specialist

You can create a mapping table with Table1 concatenating Data and Fabricante, something like this:
mapProvedor:
Load Text(Data)&'@'&Fabricante as Key, Provedor as Value Resident Table1;

Then when loading Table2, you can do:
...
ApplyMap('mapProvedor',Text(Data)&'@'&Fabricante) as Provedor
...

heitorcarlosgomes
Contributor II
Contributor II
Author

Very very good. 

It changed all my script. Much more simple now. 

Thanks!