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: 
srinivasa1
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.

23 Replies
Not applicable

You want to join 2 files and make flag for show existing products right?

So maybe your if() should be like this:


if(count(product)<=2, 1, 0)


if(understanding<>true, Sorry) ^^

srinivasa1
Creator II
Creator II
Author

thanks for reply but its not sloved my issue.[:'(]

Miguel_Angel_Baeyens

Hi,

According to your script now you have a field "ProductExistsInFileA" that stores 1 when the product exists and zero when it doesn't. So if you want to use that in an expression, Sum the number of "1"s in the table

Sum(ProductExistsInFileA)


or just create a listbox for that field and select "1" to see only those that already exist.

Is that what you want?

rbecher
MVP
MVP

I don't know what your problem is. If you want to show if product is in two tables you can use the inner join to get a resulting table with all products that are in both tables. You can show this..

The second solution would be a concatenated load with a count aggregation as described above.

If this is not sufficient you should give us more details about your demand.

- Ralf

Astrato.io Head of R&D
Not applicable

so this means i understand it wrong?

previous script was wrong. if(count(product)<1, 1, 0) as flag

or you want load 2 excel file and make table for only existing products? If is it right then just use inner join.

BTW almost always Miguel's right. follow him ^^

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

look at the attached file!

srinivasa1
Creator II
Creator II
Author

Hi Thanks for your reply.i have two file as bellow

FILE A

Sr no Product

1 P1

2 p2

3 p3

and

FILE AB

Sr no Product

1 P1

2 p4

3 p5

after compare i need to disply product p1 as its existed in both the table pls help me

srinivasa1
Creator II
Creator II
Author

Hi Thanks for your reply.i have two file as bellow

FILE A

Sr no Product

1 P1

2 p2

3 p3

and

FILE AB

Sr no Product

1 P1

2 p4

3 p5

after compare i need to disply product p1 as its in both the table pls help me

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

I have entered a new field in the script: Marker, of course you can also use a flag like 1 As Flag:

TableC:
NoConcatenate
Load "Sr no A" As SRNoAB,
'Product in both tables' As Marker,
Product
Resident TableA;

Inner Join (TableC)
Load "Sr no B" As SRNoAB,
'Product in both tables' As Marker,
Product
Resident TableB;

srinivasa1
Creator II
Creator II
Author

Hi thanks for your reply. im stii little confuse how i can use ur script in my bellow script

TableA:
LOAD
Srno ,
Product

FROM
QvdCompare.xlsx
(ooxml, embedded labels) ;
TableB:
LOAD
Srno ,
Product
FROM
QvdCompare2.xlsx
(ooxml, embedded labels);

can any one pls guide me.