1 Reply Latest reply on Sep 14, 2018 8:38 PM by Rajesh Jaiswal

    How To Compare Data of Two Dimensions having some different and some equal value from two different data sources using data blending/any other way

    Rajesh Jaiswal

      Hi All,

       

      I have two data sources 1) Hive Table and Mysql Table

      1) Hive Table have below data

       

      Rack Type    |     Region     |     Year     |     Quarter     |      Count_HIVE

      N                       ATB               2019               Q1               22

      N                       PNB               2019              Q1               11

      N                       TKH               2019               Q1               20

       

      2) MYSQL TABLEA

      Rack Type    |     Region     |     Year     |     Quarter     |      Count_MYSQL

      N                       ATB               2019               Q1               20

      N                       PNB               2019              Q1               10

       

      Now I want to compare data change considering Hive table as my Base on Rack Type Level, Region Level

      CASE 1: Region column not a part of data blending relation ship

       

      /* Delta= SUM(Count_HIVE)-SUM(Count_MYSQL)

      *                               =53-30

      *                              =23

      */

      Rack Type Level Value(Correct Value):

       

      Rack Type              Delta

      N                           23

       

      Region Level Value( Incorrect Value) is should be (20)

      Rack Type          Region    Delta

      N                          TKH         -10

       

       

      CASE 2: Region column  part of data blending relation ship

       

      /* Delta= SUM(Count_HIVE)-SUM(Count_MYSQL)

      *                               =53-30

      *                              =23

      */

      Rack Type Level Value(InCorrect Value) it should be 23:

       

      Rack Type              Delta

      N                           3

       

      Region Level Value( correct Value)

      Rack Type          Region    Delta

      N                          TKH         20

       

      Please help me out of this.

       

      Note: Hive table is from hive database live and mysql data is mysql live table

       

       

      Thank you.

      Rajesh Jaiswal