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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Vlookup Emule

Hello!

I'm trying to emule a vlookup (Excel) this is my scenario:

I have 1 table is call Consumo:

Here a I have many fields like rut name etc: but I need to use This:

SUCURSAL         as Cod_Sucursal,

My other table has:

Sucursales:

LOAD [Nº Sucursal]                                         as Nº_Sucursal,

     Nombre                                                            as Nombre_Sucursal

     //Cod_EBSO

The idea is lookup the code of sucursal and paste inside Mag:

I put:

MapSucursal:

Mapping Load Nº_Sucursal,Nombre_Sucursal Resident Sucursales;

Join(Consumo)

Load Cod_Sucursal,ApplyMap('MapSucursal',Cod_Sucursal,Null()) as Nombre_Sucursal_Consumo Resident Consumo;

But Memory problem Appears.

What can it be?

Thanks!

Labels (1)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You are doing this the right way - the Applymap looks OK, but something is going wrong with the join. Is Cod_Sucursal a unique key in Consumo?

If not, perhaps you need

Join(Consumo)

Load DISTINCT Cod_Sucursal,

          ApplyMap('MapSucursal', Cod_Sucursal, Null()) As Nombre_Sucursal_Consumo

Resident Consumo

Another question is whether the field Nombre_Sucursal_Consumo already exists in Consumo? (Perhaps you are doing this in a loop).

It may help if you provide a little more information, such as the number of rows in Consumo and in your mapping table, and more details of your script.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
pgalvezt
Specialist
Specialist
Author

Any Help?

Thanks!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The function you're looking for is Lookup. It works pretty much the same as vlookup in excel. But depending on the situation you may be better of using a mapping table and applymap. See http://community.qlik.com/docs/DOC-3412 for more details


talk is cheap, supply exceeds demand
pgalvezt
Specialist
Specialist
Author

Hello gwassenaar thanks for your reply. I forgot to tell you that I'm using QV 10. I think that this function that you telling me is available in QV 11 right? So I got to think in another option. If you can help me with my applymap (upper) I will appreciate it.

Thanks!

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You are doing this the right way - the Applymap looks OK, but something is going wrong with the join. Is Cod_Sucursal a unique key in Consumo?

If not, perhaps you need

Join(Consumo)

Load DISTINCT Cod_Sucursal,

          ApplyMap('MapSucursal', Cod_Sucursal, Null()) As Nombre_Sucursal_Consumo

Resident Consumo

Another question is whether the field Nombre_Sucursal_Consumo already exists in Consumo? (Perhaps you are doing this in a loop).

It may help if you provide a little more information, such as the number of rows in Consumo and in your mapping table, and more details of your script.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
pgalvezt
Specialist
Specialist
Author

Thanks Jonathan! Works fine (Distinct was the solution).