Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Join on specific columns

Hi,

I wonder if anyone could shed some light on this for me please.

I have many tables that contain a huge amount of information, however I want to evaluate the software so I've created a specific example that makes use of three seperate tables that all contain information about customers.  I want to link these tables together so that I can display any combination of data from the three data sources at a later point in time.  I understand that I can join tables together, however QlikView appears to be automatically determining which field to join on and it's getting this wrong (each table has a seperate auto-increment column called id, which is independant of the other tables but appears first in the field list).

Is it possible for me to force a join on a specific column?

Any pointers would be much appreciated!

Thanks,

Richard

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Qlikview by default joins tables based on the column names, so you should rename the other column names to avoid join based on other columns.  You can rename the column names by using "AS" keyword.  This way you can join the tables based on the specified condition.

Regards,

Jagan.

View solution in original post

4 Replies
whiteline
Master II
Master II

  QlikView appears to be automatically determining which field to join

Hi.

You can use 'as' statement to rename fields in script. QV 'joins' them by field names.

I think you'd better read the basic tutorual or even reference manual...

jagan
Luminary Alumni
Luminary Alumni

Hi,

Qlikview by default joins tables based on the column names, so you should rename the other column names to avoid join based on other columns.  You can rename the column names by using "AS" keyword.  This way you can join the tables based on the specified condition.

Regards,

Jagan.

Not applicable
Author

Thanks for the help. 

I had read the documentation, my problem is that after I've finished my example case I need build a live system.  Our system contains a lot of data across multiple databases and hundreds of tables and I'm concious that specifically defining each column (so that I can create aliases) will be very time consuming.  If I could just SELECT * on these tables and then manually add the joins it wouldn't have been as bad, hence my question.

I'll see if I can automate the creation of the script though.

Thanks again

whiteline
Master II
Master II

You could use 'qualify' statement.

It adds a table name to the names of specified fields (you can also use *, look at help, there are some examples).

Then you can manually perform joins renaming key fields corresponding to your needs.