SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a little trouble with some syntax for my xslt statement on a custom sharepoint page, any help would be much appricated.

I've summed a column from a list and it displays correctly (code below):

<xsl:value-of select="format-number(sum(dsQueryResponse/Rows/Row/@Capex), '$#,##0.00;-$#,##0.00')" />

However what won't work is when I try to apply a condition to the summed column. For example I am trying to Sum only where projects are still active. I have the code below, and would appricate any thoughts to get it working.

<xsl:value-of select="sum(/dsQueryResponse/Rows/Row[(@Capex) and (@ProjectStatus)='Active'])" />

The result of the above is NaN, so assume I need to do some formatting of the non-numeric section, I just haven't been able to get that working. Help!

share|improve this question

I think you need to define the filter after the sum element. Something like:

<xsl:value-of select="sum(/dsQueryResponse/Rows/Row/@Capex[@ProjectStatus='Active'])" />

There are some more examples here - - which may help you to refine the formula.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.