Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • noel 1 post 21 karma points
    Mar 27, 2011 @ 13:03
    noel
    0

    Recalculate average

    Hi,

    I am trying to recalculate the average that I come up with in XSLT. Is this possible? Below is my code:

      <xsl:variable name="dvt_ParentRow" select="current()" />
      <xsl:variable name="Rows" select="../../../SubTasks/Rows/Row[@TaskID=$dvt_ParentRow/@TaskID]" />
      
      <xsl:variable name="average" select="sum(../../../SubTasks/Rows/Row[@TaskID=$dvt_ParentRow/@TaskID]/@PercentComplete) div count(../../../SubTasks/Rows/Row[@TaskID=$dvt_ParentRow/@TaskID]/@PercentComplete)" />
       
      <xsl:variable name="dvt_RowCount" select="count($Rows)" />

    The code does calculate average for each task, now I want to average all tasks per each projects. Any help is appreciated.

     

Please Sign in or register to post replies

Write your reply to:

Draft