Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I need to compare 2 file eg
FILE A
Sr no Product
1 P1
2 p2
3 p3
and
FILE AB
Sr no Product
1 P1
2 p4
3 p5
in this i wanted know product exists in both the table pls guide me how i can do this comparison.
thanks in advance.
Hi,
change your script like this, than stays only TableD (=TableA without product in both tables) and TableE (=TableB without product in both tables):
TableC:
NoConcatenate
Load "Sr no A" As SRNoAB,
'Product in both tables' As Marker,
Product,
Product As ProductBoth
Resident TableA;
Inner Join (TableC)
Load "Sr no B" As SRNoAB,
'Product in both tables' As Marker,
Product,
Product As ProductBoth
Resident TableB;
TableD:
NoConcatenate
LOAD * Resident TableA
Where Not Exists(ProductBoth,Product);
TableD:
NoConcatenate
LOAD * Resident TableB
Where Not Exists(ProductBoth,Product);
Drop Table TableA, TableB, TableC;
Hi,
best way would be an inner join:
Data:
Load * From TableA;
Inner Join (Data)
Load * Fraom TableB;
Hello
Assuming that the key field is "Product", then you can do something like the following:
FileAB:NOCONCATENATE LOAD "Sr no" AS "Sr no AB", Product AS "Product AB", If(Exists(Product), 1, 0) AS ProductExistsInFileAFROM Source;
Hope that helps.
Hi,
just load and join these tweo tables:
LOAD [Sr no], [Product] FROM FILE_A.qvd (qvd);
INNER JOIN LOAD [Sr no], [Product] FROM FILE_AB.qvd (qvd);
- Ralf
Hi
Thanks for your reply.but i need disply that product exists in both the table ..
Hi
Thanks for your reply.but i need disply that product exists in both the table ..i think inner join will dispy only matching recods in both the table.
Add a GROUP BY to to load and you can group the result by Product, and thereby only get one row per product
Hi,
but you can load all three tables, TableA, TableB and the inner join of both tables!
Hi thanks for your reply.i written code as bellow
A:
LOAD
Srno
,
Product
//Product as Key_Product
FROM
QvdCompare.xlsx
(
ooxml, embedded labels) ;
Join
LOAD
Srno
,
Product
//Product as Key_Product
FROM
QvdCompare2.xlsx
(
ooxml, embedded labels);
store
A intoA.qvd;
FileAB:
NOCONCATENATE
LOAD Srno AS "Sr no AB",
Product
AS "Product AB",
If
(Exists(Product), 1, 0) ASProductExistsInFileA
from
A.qvd
(
);
where i need to use group by if i want show value existed in both the table.
Hi thanks for your reply.i written code as bellow
A:
LOAD
Srno
,
Product
//Product as Key_Product
FROM
QvdCompare.xlsx
(
ooxml, embedded labels) ;
Join
LOAD
Srno
,
Product
//Product as Key_Product
FROM
QvdCompare2.xlsx
(
ooxml, embedded labels);
store
A intoA.qvd;
FileAB:
NOCONCATENATE
LOAD Srno AS "Sr no AB",
Product
AS "Product AB",
If
(Exists(Product), 1, 0) ASProductExistsInFileA
from
A.qvd
(
qvd
);
where i need to use join if i want show value existed in both the table.