Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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 ...
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)
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.
thanks to the idea