Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys
I am joining 2 seperate data sources on a Vehicle Vin
Table 1:
Load
Vehicle.VINNumber as %VIN
from $(vQVDLOADPATH_Source1)Vehicle.qvd (qvd);
Table 2
LOAD
Vehicle.VIN AS %VIN,
* FROM $(vQVDLOADPATH_Source2)Vehicle.QVD (qvd);
What can i write so i only Load Unique results from Table 2
Because Tablle 1 has thousands rows of data and Table 2 only has 52 i only want to Dislpay 52 over the whole report.
Thanks all
Would this be a situation where a OUTER JOIN would be used?
Hi Robert
No sorry cannot join the tables
Just duplicate the fields and use the field from the table you need.
Table1:
Load
Vehicle.VINNumber as %VIN,
Vehicle.VINNumber as Table1.VIN
from $(vQVDLOADPATH_Source1)Vehicle.qvd (qvd);
Table 2:
NoConcatenate
LOAD
Vehicle.VIN AS %VIN,
Vehicle.VINNumber as Table2.VIN
* FROM $(vQVDLOADPATH_Source2)Vehicle.QVD (qvd);
Would it matter there are pages of data between these two tables?
E.g
Table1:
Load
Vehicle.VINNumber as %VIN,
Vehicle.VINNumber as Table1.VIN
from $(vQVDLOADPATH_Source1)Vehicle.qvd (qvd);
Buyer:
LOAD * FROM $(vQVDLOADPATH)Buyer.QVD (qvd);
SaleAgreement:
LOAD * FROM $(vQVDLOADPATH)SaleAgreement.QVD (qvd);
SaleChannel:
LOAD * FROM $(vQVDLOADPATH)SaleChannel.QVD (qvd);
SaleChannel_history:
LOAD * FROM $(vQVDLOADPATH)SaleChannel_history.QVD (qvd);
Table 2:
NoConcatenate
LOAD
Vehicle.VIN AS %VIN,
Vehicle.VINNumber as Table2.VIN
* FROM $(vQVDLOADPATH_Source2)Vehicle.QVD (qvd);
Hi Adil,
In your case why do you required table 1 if you just want unique record from table2?
2nd if want unique record from both table without joining you can use inner keep which will give 2 separate table with unique record in both.
or you want records from table 2 you can go for Jose solution.
Thanks & Regards,
Kiran Kokade
HI Kiran
Table 2 contains data from a different datasource and contains data needed.
When i load this up all data is selected in the script i do not want to load 1,000,000 rows when i just need 52.
Thanks
Hi Adil,
Any reason to load data from table 1 then?
Thanks & Regards
Kiran Kokade
You can't avoid to load all the records from table1 in the script if you don't use a WHERE condition at the SQL sentence. That is independent on what do you want to show in your dashboard after the loading script. You really need to use a join like Kiran sais above if you want to discard rows from table1, but initially you must load the rows...