Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with Joining

I just recently started on this project and ran into this issue when I need to bring in data from two different sources and combine them with the original table.  Now what my issue is how can I join Table_2 and Table_3 with Table_1.

Table_1:

LOAD

          Field1,

          Field2,

          Field3

FROM

          D:\USERNAME\file1.qvd (qvd)

;

Table_2:

LOAD

          Field3,

          Field4

FROM

          D:\USERNAME\file2.qvd (qvd)

WHERE

          EXISTS(Field3)

;

Table_3:

LOAD

          Field2,

          Field4

FROM

          D:\USERNAME\file3.qvd (qvd)

WHERE

          EXISTS(Field2)

;

End Result Needed

Table_1:

Field1,

Field2,

Field3,

Field4

1 Solution

Accepted Solutions
Not applicable
Author

Concatenate will work, but it's a different result than Joining. 

Concatenate will simply append new records to the result set, using Null() for fields not available that are already in the Table. 

Join (which can be Left, Right, or Inner, or Outer) will link records based on common field(s), then append columns.  See QV help for details, but this is quite similar to a RDMS concept of joins, except that it's going to add the columns to the base table rather than just form a relationship.

View solution in original post

4 Replies
Not applicable
Author

You will get a circular reference if you load it this way, because QV will auto-assocate all 3 tables.

If you want to Join, I think what you are after this is:

Table1:

load

Field1, Field2, Field3

From ...

join (Table1) load

Field3, Field4

From ...

join (Table1) load

Field2, Field4

From ...

Not applicable
Author

try use "concatenate"

Table_1:

LOAD

          Field1,

          Field2,

          Field3

FROM

          D:\USERNAME\file1.qvd (qvd)

concatenate

LOAD

          Field3,

          Field4

FROM

          D:\USERNAME\file2.qvd (qvd)

concatenate

LOAD

          Field2,

          Field4

FROM

          D:\USERNAME\file3.qvd (qvd)

Not applicable
Author

Concatenate will work, but it's a different result than Joining. 

Concatenate will simply append new records to the result set, using Null() for fields not available that are already in the Table. 

Join (which can be Left, Right, or Inner, or Outer) will link records based on common field(s), then append columns.  See QV help for details, but this is quite similar to a RDMS concept of joins, except that it's going to add the columns to the base table rather than just form a relationship.

Not applicable
Author

thanks to the idea