6 Replies Latest reply: Apr 18, 2018 2:00 PM by Mike HOWARD RSS

    Using a variable in the load script

    Mike HOWARD

      I have created a variable called vCurrentOP which in this case is equal to 11.  Later in the load, I want to compare the operating period (field named Period) to the vCurrentOP variable and  if Period is greater then enter 'F' and if less then enter 'P' in a field called Future.


      Here is the formula in the load:


      if(Right([FYOP],2)*1 > ('$(vCurrentOP)'), 'F', 'P') as Future


      The problem is everything results in  'F'.


      As mentioned, the variable is created earlier in the load and I used this formula to create it:


      Let vCurrentOP = '=max(CP)'


      The field CP is currently equal to 11 which is the current operating period.  In the actual app, I can use the variable and it has the correct value.


      I should end up with all periods less than or equal to 11 having a P and those greater than 11 having a F in the field Future.