9 Replies Latest reply: Feb 13, 2013 10:21 AM by Raj Vadde RSS

    Left join issue

    Raj Vadde

      i'm trying to do a left join to bring one set of values to my main table. but it show null for the added coulmn

       

      but when i remove join and load it as a seperate values it giving us correct values ..

       

      how to fix this issue ? this the script;

       

       

      table1:
      Load
      Product&'-'&[Package Type]&'-'&kWeekKey as kOOChemKey,
      kWeekKey,
      [Customer Requested Delivery Date],
      [Business Segment],
      Product,
      [Order Status],
      [Package Type],
      sum(GALLON) as CFENRL

      Resident tablex
      Group by [Customer Requested Delivery Date],kWeekKey,[Order Status],[Business Segment], Product, [Package Type];

      left join 


      Load
      Product&'-'&[Package Type]&'-'&kWeekKey as kOOChemKey,
      kWeekKey,
      [Customer Requested Delivery Date],
      [Business Segment],
      Product,
      [Order Status],
      [Package Type],
      sum(GALLON) as CFEN

      Resident tablex
      Where [Order Status]<>'RL'
      Group by [Customer Requested Delivery Date],kWeekKey,[Order Status],[Business Segment], Product, [Package Type];

       

      values for CFEN are all null for my main table1

       

      Any suggestion plz