Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Comparing two qvd file

How will I be able to get values from a qvd file which are not available when compared to other qvd. For example I have Contract Account and Document Number in a qvd file (qvd1). I want to get all those Document Numbers from qvd2 that were not in qvd1. Thank you in advance.

1 Solution

Accepted Solutions
MVP
MVP

Re: Comparing two qvd file

Hi,

Please check the attached file for solution.

Hope this helps you.

Regards,

Jagan.

7 Replies
MVP
MVP

Comparing two qvd file

Hi,

Try like this

Table1:

LOAD

     ContractAccount,

     DocumentNumber

FROM FileName1.QVD;

Table2:

LOAD

     ContractAccount,

     DocumentNumber

FROM FileName1.QVD

WHERE NOT EXISTS(DocumentNumber);

Hope this helps you.

Regards,

Jagan.

Not applicable

Comparing two qvd file

I tried this but it did not work. Here's what I actually did.

Table1:
LOAD
    VKONT,
OPBEL
FROM test.qvd;

 
Table2:
LOAD
    trim(right(VKONTHist,8)) as VKONT,
OPBELHist as OPBEL,
FROM test2.qvd WHERE NOT EXISTS(OPBEL);

MVP
MVP

Comparing two qvd file

Hi,

Try renaming OPBELHist as OPBEL in the QVD itself and then do the same.

Regards,

Jagan.

Not applicable

Comparing two qvd file

Hi Jagan,

I tried what you suggested but it still did not work.

Heres what I'm trying to do.

QVD1QVD2
CONTACCTDOCNUMCONTACCTDOCNUM
1a1a
b2c
2c3e
3d
e

I just want to get only docnum B and D since it is not in QVD2. Thank you in advance.

MVP
MVP

Re: Comparing two qvd file

Hi,

Please check the attached file for solution.

Hope this helps you.

Regards,

Jagan.

Not applicable

Re: Comparing two qvd file

You should do it like this:

Table1:
LOAD
VKONT,
OPBEL
FROM test.qvd;


Table2:
LOAD
trim(right(VKONTHist,8)) as VKONT,
OPBELHist as OPBEL,
FROM test2.qvd WHERE NOT EXISTS(OPBEL,OPBELHist );

I added a secon parameter to the exist function. Since when you try for the existens you dont have OPBEL in test2.qvd.

Not applicable

Comparing two qvd file

Hi Jagan and Hansiola,

It did work. Thank you very much for the help.

Regards,

JC

Community Browser