Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3074

Comparing 2 blocks/tables

$
0
0

Hello Everybody,

 

I created a report based on the multi source universe, one source is from DB2 and the other is from Oracle.

I created 2 queries.

There are 5 dimensions on each queries.

Query 1: [Air Date Time]; [Air Day]; [Channel Id]; [Program Id]; [Program Title]. (oracle)

Query 2: [Air Date Time]; [Air Day]; [Channel Id]; [Program Id]; [Program Title]. (DB2)

I have a requirement to find out the differences (Duplicates and missed records) between query 1 and query 2.

 

Query 1

Air Date TimeAir DayChannel IdProgram IdProgram Title
11/19/2015  3:30:00 PM11/19/20151102AA0011TEST01
11/19/2015  4:30:00 PM11/19/20151102AA0022TEST01
11/19/2015  4:30:00 PM11/19/20151102AA0022TEST01
11/20/2015  6:30:00 AM11/19/20151102AA0033TEST01
11/20/2015  6:30:00 PM11/20/20151102AA0044TEST01
11/20/2015  6:30:00 PM11/20/20151198AA0055TEST01

 

Query 2
Air Date TimeAir DayChannel IdProgram IdProgram Title
11/19/2015  3:30:00 PM11/19/20151102AA0011TEST01
11/19/2015  4:30:00 PM11/19/20151102AA0022TEST01
11/20/2015  6:30:00 PM11/20/20151102AA0044TEST01
11/20/2015  6:30:00 PM11/20/20151198AA0055TEST01
11/20/2015  6:30:00 PM11/20/20151198AA0055TEST01

The result should be:

 

Air Date TimeAir DayChannel IdProgram IDProgram TitleComment
11/19/2015  4:30:00 PM11/19/20151102AA0022TEST01Duplicates from query 1
11/20/2015  6:30:00 AM11/19/20151102AA0033TEST01Missed record from query 2
11/20/2015  6:30:00 PM11/20/20151198AA0055TEST01Duplicates from query 2

 

I already created merged dimensions and the logic to compare but it did not give me the correct result.

Please help me with this issue.

Any suggestion will be helpful.

 

Thank you so much.

 

 

 



Viewing all articles
Browse latest Browse all 3074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>