Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for Data Integration and Data Analytics gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

2 QVD Compare

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.

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

AW:Re: AW:Re: AW:2 QVD Compare

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;

View solution in original post

23 Replies
Highlighted
Partner
Partner

AW:2 QVD Compare

Hi,

best way would be an inner join:

Data:
Load * From TableA;

Inner Join (Data)
Load * Fraom TableB;

Highlighted

2 QVD Compare

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.

Highlighted
MVP & Luminary
MVP & Luminary

2 QVD Compare

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

Vizlib Head of R&D
Highlighted
Creator II
Creator II

2 QVD Compare

Hi

Thanks for your reply.but i need disply that product exists in both the table ..

Highlighted
Creator II
Creator II

2 QVD Compare

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.

Highlighted
Employee
Employee

SV:Re: 2 QVD Compare

Add a GROUP BY to to load and you can group the result by Product, and thereby only get one row per product

Highlighted
Partner
Partner

AW:Re: 2 QVD Compare

Hi,

but you can load all three tables, TableA, TableB and the inner join of both tables!

Highlighted
Creator II
Creator II

AW:Re: 2 QVD Compare

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 into

A.qvd;

FileAB:



NOCONCATENATE

LOAD Srno AS "Sr no AB"

,

Product

AS "Product AB"

,

If

(Exists(Product), 1, 0) AS

ProductExistsInFileA

from

A.qvd

(



qvd

);

where i need to use group by if i want show value existed in both the table.





Highlighted
Creator II
Creator II

AW:Re: 2 QVD Compare

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 into

A.qvd;

FileAB:



NOCONCATENATE

LOAD Srno AS "Sr no AB"

,

Product

AS "Product AB"

,

If

(Exists(Product), 1, 0) AS

ProductExistsInFileA

from



A.qvd

(



qvd

);

where i need to use join if i want show value existed in both the table.