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: 
camilo
Contributor III
Contributor III

Problem linking tables

Hi,

I´m loading 3 tables but I don´t know why the key fields (ID_Categoria,Departamento) aren´t working correclty, the model doesn´t link the info from Table1 with Table3. In Table1 just the field ID_Categoria should be sufficient to link that table with table 3, but this doesnt work, thats why I´m trying to complement that info adding the Departamento field with a lookup function but this doesn´t work either.

Please any advice would be welcome thanks!!!

//Table 1

Stage1.2v2:

LOAD Fecha,

id_local_int    as ID,

ID_Categoria,

Venta           as VentaP,

[Margen dia     as MargenP

FROM

(qvd);

Stage1.2:

Load*, lookup('Departamento','ID_Categoria',ID_Categoria,'Categoria')as Departamento

Resident Stage1.2v2;

Drop table Stage1.2v2;

Concatenate

//Table 2

LOAD Replace([N° Local],' ','')           as ID,

Replace([DepartamentoSAP],'','')   as Departamento,

Dia                             as Fecha,

[Unidades Vendidas],

[Venta Neta $]                       as Venta,

[Costo Venta $]                      as Costo,

Margen

FROM

(qvd);

//Table3

Categoria:

LOAD ID_Area,

Area,

ID_Departamento,

Departamento,

ID_Categoria,

Categoria

FROM

(qvd);

3 Replies
Not applicable

I think you should Create the QVD Files with the final field name for the three tables, after that load all tables and see what hapens.

Not applicable

Dear Camio,

     I don't see any problem in your script but then too I would suggest you to go step by step.

First load table 1:

//Table 1

Stage1.2v2:

LOAD Fecha,

id_local_int    as ID,

ID_Categoria,

Venta           as VentaP,

[Margen dia     as MargenP

FROM

(qvd);

then load table 3:

//Table3

Categoria:

LOAD ID_Area,

Area,

ID_Departamento,

Departamento,

ID_Categoria,

Categoria

FROM

(qvd);

then see if they are linking properly....make sure you are not qualifying the fields.

to see, their links try to search for any ID_Categoria which you aure will be available in both.

then see if you are getting its info from both the tables...

hope it helps to proceed you..



camilo
Contributor III
Contributor III
Author

Hi,

I´m not qualifiing any field, if I don´t use the Concatenate both tables (table1 and table2) got linked correctly with table 3 (but a lot of sinc key appears), but something happens when y use the concatenate that I loose that link.

I´ll try creating the qvd file with the same field names and see what happens.

Any other advice?

thanks,

Camilo