9 Replies Latest reply: Jul 23, 2012 10:57 AM by Rahul Lakhina RSS

    Field Value lost after left join.

    Joe Kirwan

      I have 2 tables as described below.

       

      Val Lost on Left Joun 01.PNG

      Now I want to add a calculated field ("IncVal"), which I do by creating a temporary table containing the field, then doing a join before I drop the temporary table.

       

      If I look at the data before I drop the temporary table, I can see that the IncVal in computing correctly.

       

      But when I look after I drop the table, there is no value for field IncVal.

       

      Any ideas?

       

      temp3:
      load Order_Num,
          
      InvDate,
          
      InvVal,
          
      Flag1,
          
      Flag2,
          
      If(Flag2='A',InvVal*(MonthEnd(InvDate)-InvDate)/Day(MonthEnd(InvDate)),

      If(Flag1='X',InvVal*(InvDateMonthStart(InvDate))/Day(MonthEnd(InvDate)),

      InvVal)) as IncVal
         
      resident t2 ;

      left join (t2) load * resident temp3;


      drop table temp3