5 Replies Latest reply: Jan 17, 2014 6:50 AM by Srikanth Narasimhan RSS

    Setting values to fields based on values of other fields

      Hi,

       

      I have 3 fields and I want to reset all the 3 fields to 0, even if one of them is 0. Can I set the fields in LOAD statement like this? I did not get any error, but did not get the desired effect either.

       

      Thanks

       

       

      LOAD *,

      If([Energy Diff] = 0 OR [MedianModTemp] = 0 OR [MedianIrr] = 0, [MedianModTemp] = 0)

      ;

      LOAD *,

      If([Energy Diff] = 0 OR [MedianModTemp] = 0 OR [MedianIrr] = 0, [MedianIrr] = 0)

      ;

      LOAD *,

      If([Energy Diff] = 0 OR [MedianModTemp] = 0 OR [MedianIrr] = 0, [MedianIrr] = 0)

      ;

      LOAD Project,

      ...

           Energy,

           Irr1,

           Irr2,

           ModTemp1,

           ModTemp2,

           Energy - (if (IsNull (Previous(Energy)),0,Previous(Energy))) as [Energy Diff],

           (if (IsNull(ModTemp1),0,ModTemp1) + if(IsNull(ModTemp2),0,ModTemp2))/2  as [MedianModTemp],

           (if (IsNull(Irr1),0,Irr1) + if(IsNull(Irr2),0,Irr2))/2 as [MedianIrr],

      ...