Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
Any Help?
Thanks!
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
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!
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
Thanks Jonathan! Works fine (Distinct was the solution).