Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Join on specific columns

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.

4 Replies
whiteline
Honored Contributor II

Re: Join on specific columns

  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...

MVP
MVP

Re: Join on specific columns

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

Re: Join on specific columns

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
Honored Contributor II

Re: Join on specific columns

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.

Community Browser