28 Replies Latest reply: May 16, 2018 11:26 AM by Bharat Kishore RSS

    Join

    Bharat Kishore

      Hi All,

       

      I have the following code:

       

      T1:

      LOAD distinct Plant,

           If(Country='Korea, Republic of','Korea',

               if(Country='Russian Federation','Russia',

                 if(Country='United Arab Emirates','Arab Emirates',

                    if(Country='United States','USA',

                      if(Country='Viet Nam','Vietnam',Country))))) as Country,

           Comment_New,

           BU,

           District,

           [System Code],

           Entitlement,

           [Material Groups],

           Flag,

           YearMonth,

          

           Cons_YTD,

          

           Cons_YTD_LY

          

      FROM

      [..\5_QVD\IS_QVD4\Modality_Report_temp14bb.qvd]

      (qvd);

       

       

      left join(T1)

       

       

      LOAD distinct Plant,

           Part_Type as Comment_New,

           Contract_Type as Entitlement,

           BUEqui as BU,

      //     Country,

           Strategic_Flag as Flag,

           YearMonth,

      //     Fiscal_Month,

      //     Calendar_Year,

           ITM_Consumption,

           ITM_IB,

           YTD_Consumption,

           YTD_IB,

           YTD_Consumption_LY  ,

           YTD_IB_LY,

           ADJ_CONS_YTD_LY,

      //     Country_CR,

      //     Country_Final_temp,

            If(Country_Final='Korea, Republic of','Korea',

               if(Country_Final='Russian Federation','Russia',

                 if(Country_Final='United Arab Emirates','Arab Emirates',

                    if(Country_Final='United States','USA',

                      if(Country_Final='Viet Nam','Vietnam',Country_Final))))) as Country

      FROM

      [..\5_QVD\IS_QVD4\Adj_Factors_for_Modality_report_Query4.qvd]

      (qvd);

       

       

      But when i do a left join the values are getting wrong for ADJ_CONS_YTD_LY. Before join i am getting around 497k but after join i am getting 2511K

       

      Can you please help me where i am doing wrong.

       

      Thanks,

      Bharat