Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Join two tables by a field with diferent name

I have this JOIN:

Presupuestos_productos:

LOAD año,

     producto,

     presupuestos

FROM

(ooxml, embedded labels, table is Hoja1);

RIGHT JOIN(Presupuestos_productos)

LOAD Year(fecha) as año,

  cod_producto,

  sum(venta) as ventas

Resident Ventas

  GROUP BY Year(fecha), producto;

Is there anyway to do tha join by  producto - cod_producto.   I don't want to rename the field because I use it in other process with this name. Is possibe to make a join by fields of diferent name?

Thanks in advance,

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Juan,

AQL is the name of Qlik technology that handles the logic of joing tables (and a lot of other features).

Short answer is no, same columns names is the way AQL works to create linking.

Workarounds are creating triggers that on every selection in one table propagates the same selection to other OR

creating SET ANALYSIS expressions that logically 'join' the tables

Both workarounds are very CPU intensive and not recommended

Best Regards

View solution in original post

4 Replies
julian_rodriguez
Partner - Specialist
Partner - Specialist

Hola Juan

De esta manera, tendrás los dos campos y las tablas se unirán, saludos

Presupuestos_productos:

LOAD año,

     producto,

    producto as cod_producto,

     presupuestos

FROM

(ooxml, embedded labels, table is Hoja1);

RIGHT JOIN(Presupuestos_productos)

LOAD Year(fecha) as año,

  cod_producto,

  sum(venta) as ventas

Resident Ventas

  GROUP BY Year(fecha), producto;

Anonymous
Not applicable
Author

Gracias Julian,

Mi pregunta era si se pueden unir sin renombrar los campos. Sé que renombrandolos se puede hacer, pero es lo que quiero evitar. Simplemente saber si se pueden unir aunque no tengan mismo nombre como se hace por ejemplo en un JOIN de SQL.

Un saludo,

Juan

Clever_Anjos
Employee
Employee

Juan,

AQL is the name of Qlik technology that handles the logic of joing tables (and a lot of other features).

Short answer is no, same columns names is the way AQL works to create linking.

Workarounds are creating triggers that on every selection in one table propagates the same selection to other OR

creating SET ANALYSIS expressions that logically 'join' the tables

Both workarounds are very CPU intensive and not recommended

Best Regards

julian_rodriguez
Partner - Specialist
Partner - Specialist

Juan, según la pregunta dices que lo necesitas para un proceso más adelante, y creando un campo adicional con otro nombre puedes usarlo así más adelante y luego, si deseas, eliminarlo.

Sobre si hay posibilidad de hacer el join sin renombrarlos, no que yo sepa.

Saludos