Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

JOIN ON TWO VARIABLES WITH DIFFERENT NAMES

Hello,

I have a problem with joining two tables on variables with different names:

For Example I have two tables

1- Clienti :column names A, B, C

2- Dati: column names D,E, F

I need to join this tables on Clienti.A = Dati.D

I knwo then i can do this, renaming the column A e D in the same name , but I need to take them with different names for doing multiple joins.

Can somebody help me??????

I've done the following sql select but it gives me an syntax error:

Select

DISTINCTROW

Clienti.A,



Clienti.B , Clienti.C, Dati.D, Dati.E, Dati.F

from

Clienti LEFT JOIN Dati

ON Clienti.A = Dati.D;



Thank you very much....

5 Replies
Not applicable
Author

Maybe have two variables in your load?

i.e

load A, B, C, B as D;

load D,E,F;

I've had to do that a few times.

Mike

Not applicable
Author

thank you,

but I think that this solution doesn't resolve my problem

because you are going to duplicate the key column of the first table and this is one of the things I wouldn't prefer to do.

So I would like to know , if there is a mode to do a join in QlikView equivalent of the following sql join:

select columns

from

table1 join table2

on table1.columnx = table2.columny;

Thank you........

johnw
Champion III
Champion III

Well, if you want to do it in the SQL, I think you could do this:

SELECT DISTINCT A,B,C,E,F
FROM Clienti, Dati
WHERE A = D

If you want to do it in the load, I think you could do this:

LOAD A,B,C
...
;
LEFT JOIN LOAD D AS A,E,F
...
WHERE EXISTS(A,D)
;

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

The way to join tables in QlikView is by giving join key fields identical names - that's the only way the join is done. If you need multiple joins - they, too are done using identical field names.

If you have way too many tabels and way too many joins, you might run into loops or synthetic keys, and then you need to consider some advanced data medelling techniques, like using Link Tables or Concatenating different tables into one.

But the basic rule remains the same - only identical field names can serve as join keys in QlikView.

Oleg

Not applicable
Author

thnak you .............