5 Replies Latest reply: Oct 15, 2013 6:28 AM by Anju Gopinath RSS

    Calculated value from "LOAD"

    Luca V

      Hi everybody,

      i need to calculate a value in the script.

      I have a table with field  YEAR , MONTH , INFLACTION (that doesn't change in the same YEAR) and INFLACTION FACTOR (this is the field that i need to calculate, now i put "1" in every record)  like:

      DAT:

      YEAR , MONTH , INFLACTION , INFLACTION FACTOR

      2010 ,  10 , 1 , 1

      2010 , 11 , 1 , 1

      2010, 12 , 1 , 1

      2011 , 1 , 3 ,1

      2011 , 2 , 3 , 1

      2011 , 3 , 3 ,1

      ......

      2011 , 10 , 3 , 1

      2011 , 11 , 3 ,1

      2011 , 12 , 3 , 1

      2012 , 1 , 5 , 1

      2012, 1 , 5 , 1

       

      INFLACTION FACTOR = INFLACTION FACTOR (of the previus year)  * ( 1 + INFLACTION)  

      and the first year is 1

       

      DAT_GROUP:

      Load

        `dat.year` as `dat_group.year`,

          `dat.month` as `dat_group.month`,

          `dat.INFLATION` as `dat_group.INFLATION`,

      if(Previous(`dat.year`)=(`dat.year`),Previous(`dat_group.InflationFactor`),(Previous(`dat_group.InflationFactor`)*(`dat.INFLATION`+1)))

      Resident DAT;

       

      but i can't read the value of the new table in the LOAD function.

      `dat_group.InflationFactor`   ---> launch an error

       

      Any advise ?