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 have a DVWP that displays groups of data. For each group, I've got a sum of one of the columns. This sum exists in the group footer in a template called dvt_1.groupfooter0.

<xsl:variable name="mySum" select="sum($nodeset/@myQuantity)"/>

Is there any way to filter out groups depending on this sum (e.g. if the sum is negative). I don't think that the "XSLT Filter" for the DVWP will work, since it appears to filter prior to this doesn't work:

[sum(@myQuantity) > 0]

The above discards individual rows for which myQuantity is negative.

Any suggestions?

share|improve this question
up vote 0 down vote accepted

You'd need to add the full XPath to the filter on the nodeset. Stuff like this is typically quite hard to do if you work directly with the XSL which SharePoint Designer generates.

Another way to do it is in the dvt_1.body template, doing the calculation to determine if you should call the rowview template.

Bottom line is that it's doable with XSL magic.


share|improve this answer
Thank you Marc. I will try this in the future. For this particular problem, I ended up just modifying my view in SQL Server. While I wish that things like this were easier to make happen in SPD + XSL, sometimes it just makes sense to do the heavy lifting on the back end. – Boden Oct 25 '10 at 16:56

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.