1 Reply Latest reply on Apr 17, 2012 5:11 PM by BIPuser

    How to assign a value to a variable

      Hi All,

      Need your inputs to solve my issue.
      My requirement is to getting the running total based on the value derived from the if condition.
      Below code i used to row level value.
      <?xdofx:if (nvl(ADDITION,0) >0 and nvl(ASSET_COUNT,0) > 1 )  then FIXED_ASSETS_COST     else      ADDITION   end if?>
      this will return value like below.


      I need to sum all those values and return 1,214.52 i need to assign those values to a variable and do the sum.
      Used below code
      <?xdofx:if (nvl(ADDITION,0) >0 and nvl(ASSET_COUNT,0) > 1 )?><?xdoxslt:set_variable($_XDOCTX, 'RTotVar', xdoxslt:get_variable($_XDOCTX, 'RTotVar') + FIXED_ASSETS_COST)?><?end if?>
      But it is not working.
      Please provide your inputs in achieving the same.
        • 1. Re: How to assign a value to a variable
          When you say that it is not working, do you mean that the code is not providing the desired output? Is there an error relating to the use of xdofx and xdoxslt functions?

          Change your second "if" statement to:

          <?if:(nvl(ADDITION,0) >0 and nvl(ASSET_COUNT,0) > 1)?><?xdoxslt:set_variable($_XDOCTX, 'RTotVar', xdoxslt:get_variable($_XDOCTX, 'RTotVar') + FIXED_ASSETS_COST)?><?end if?>

          1 person found this helpful