Hi,
First of all my apologies, if any relevant information has been missed out here. I am a Tester, so do not have much knowledge of Coding.
I have created a DataView in the SharePoint Designer.
In this DataView, One of the columns requires taking the average of Two Columns that are of format number percentage (2 decimals)
The Columns that are used to get the average are also getting values based on the calculations of other Columns.
Here is the Code:
Code:
</td>
<td class="style12" style="height: 20px">
<xsl:choose>
<xsl:when test="COLUMN1=0">
<xsl:value-of select="COLUMN2 div 2"></xsl:value-of>
</xsl:when>
<xsl:when test="COLUMN2=0">
<xsl:value-of select="COLUMN1 div 2"></xsl:value-of>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="(COLUMN1+COLUMN2) div 2" />
</xsl:otherwise>
</xsl:choose>
</td>
COLUMN1 has values in different rows as: 33.33%, 100.00%, 0.00%, 0
COLUMN2 has values in different rows as: 60.00%, 100.00%, 2.00%,0
As per the above data the values in COLUMN3 should be calculated as:
COLUMN3: 46.50%, 50.00%,1.00%,0
The Problem is that I get a NaN values in the Average Calculated Column as Below:
COLUMN3: NaN, NaN, NaN,0
I am not able to figure out what wrong I am doing
Please let me know if you need any further information