Search code examples
oracle-databasepeoplesoftbi-publisher

BI Publisher in Word SUM


Please note the following data:

  • COMP - 416.00

  • DEVC - 16.00

  • DEVE - 32.00

  • ELEC - 64.00

  • YCL - 32.00

In Word I created a field with the following properties:

<?for-each:SSR_AIR_PARM?><?if:SSR_ENRL_CAT!='DEVC'?><?if:SSR_ENRL_CAT!='DEVE'?><?MIN_UNITS_REQD?><?end if?><?end if?><?end for-each?>

It gives the correct:

  • 416
  • 64
  • 32

How do I sum that instead of putting out the three values?

ie. <?sum( 416, 64, 32 )?>


Solution

  • <?sum(SSR_AIR_PARM[SSR_ENRL_CAT!='DEVC' and SSR_ENRL_CAT!='DEVE']/MIN_UNITS_REQD)?>
    

    should also give the required answer,without a for loop, and without a variable. You can give the searchspec in those square brackets at the node level,and sum up the element under that node which meet the search criteria.