Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to compare data between two qvd

how to compare data is same between 2 similar qvd files

10 Replies
psk180590
Creator III
Creator III

Hi Pratheek,

What do you want to compare?

If you want to look at the data difference then you can do a Binary load into two separate qvw files and compare there.

Or might be this comparing data might help you .

Not applicable
Author

Hi Sai

I have 2 qvd files with same fields and same data and want to compare all the data in the fields are matching.

So if let me know how to do the binary load

psk180590
Creator III
Creator III

The script for Binary load is

Binary[YourQVD];

YourQVD is the name of the QVD file where you have the data.

Create a new qvw and write this statement this will fetch all the data from your QVD.

sarvesh
Creator III
Creator III

Hi..Sai,

Please refer below mentioned URL it may help you:

Compare 2 QVDs

Please remember to mark this as "helpful" & "correct answer" if your query has been solved.

This will help users identify the answers should they come across this thread in the future.



Regard's

Sarvesh Srivastava

sarvesh
Creator III
Creator III

Hi..Pratheek,

My initial idea (some years ago when dealing with a problem with Incremental loads of very large tables) was:

Make a QVW document that:

  • Loads the first version of the QVD and adds a primary key to it
  • Loads the second version of the QVD and joins it to the first (OUTER JOIN)
  • Reloads the resulting table and creates flags for all field pairs that differ.
  • Create a few UI objects with counters for nr of records and a table with counters for field differences.

If you want to do it for all fields, you're in for a lot of work. If you want to do this for a few important fields, or just to count the number of differing records, it is doable.

Please remember to mark this as "helpful" & "correct answer" if your query has been solved.

This will help users identify the answers should they come across this thread in the future.



Regard's

Sarvesh Srivastava

Not applicable
Author

Hi Sarvesh

Could you please send the scripting for my refernce

sarvesh
Creator III
Creator III

Please check the attachment.

jonathandienst
Partner - Champion III
Partner - Champion III

That will work as long as the QVDs have a unique key field. If not, the join could cause problems. For this reason, I normally concatenate the two QVDs, like so:

Data:

LOAD *,

     FileBaseName() as Source

From <first QVD>.qvd (qvd);

Concatenate(Data)

LOAD *,

     FileBaseName() as Source

From <second QVD>.qvd (qvd);

Replace the placeholders with the actual filenames.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Then use set expressions to select counts / sums / etc from file1 and file2. I usually use descriptive value for the Source field rather than the FileBaseName() as above.

So create a table with the relevant fields as dimensions, then use something like


File1 Customers:

     Count({<Source = {'<first QVD name'}>} Customer)

File2 Customers:

     Count({<Source = {'<seconds QVD name'}>} Customer)

Customer difference:

     Count({<Source = {'<first QVD name'}>} Customer) - Count({<Source = {'<seconds QVD name'}>} Customer)

File1 Transactions:

     Sum({<Source = {'<first QVD name'}>} Amount)

     ...

     and so on.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein