1 Reply Latest reply: Apr 25, 2012 3:24 PM by BIPuser RSS

    Question about referencing another field

    Jerry_J
      Ok, using the BI Publisher plug in for MS Word (10.1.3.4.1):

      I have a template that I'm creating.

      I have two calculated fields:

      <? (sum(JAN) + JAN1 + JAN2 + JAN3)+(sum(FEB) + FEB1 + FEB2 + FEB3)+(sum(MAR) + MAR1 + MAR2 + MAR3)?>
      and
      <? JAN_TOTAL+FEB_TOTAL + MAR_TOTAL?>

      I want to now create a third one, that will be basically the first one minus the second one.
      Rather than enter
      <? ((sum(JAN) + JAN1 + JAN2 + JAN3)+(sum(FEB) + FEB1 + FEB2 + FEB3)+(sum(MAR) + MAR1 + MAR2 + MAR3)) - (JAN_TOTAL+FEB_TOTAL + MAR_TOTAL) ?>

      ...is there a way that I can name the first two, and then just reference them in the third ? (Something like <? TOTAL - BUDGET ?>

      thanks, and hopefully that's clear enough!

      -j
        • 1. Re: Question about referencing another field
          BIPuser
          Assign the result of each calculation to a variable and then use the variables to derive the third value.

          Look into the xdoxslt:set_variable() and xdoxslt:get_variable() functions to do this.

          Example: <?xdoxslt:set_variable($_XDOCTX, 'var1', (JAN_TOTAL+FEB_TOTAL+MAR_TOTAL))?>
          <?xdoxslt:get_variable($_XDOCTX, 'var1')?>

          Thanks,
          Bipuser