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 Data View Web Part with a grouping. Now I have a column that contains either 'Yes' or 'No'. I am able to count the number of 'Yes' and "No' under certain grouping, however, I would like to know if there is anyway to count only 'Yes'?

Here is what the current xslt looks like:

<xsl:value-of select="count($nodeset/@Status)" /> 

Again it's counting @Status under certain nodeset but I would like to count only those @Status which has value of 'Yes'.

Any help will be greatly appreciated.

share|improve this question
up vote 0 down vote accepted

Untested since I don't have your particular nodeset but it should be something similar to the following:

<xsl:value-of select="count($nodeset[@Status='Yes'])" /> 

The XPATH may need some work but you can put conditions within brackets like that.

share|improve this answer
Thank you awesome! Im bit new to XSLT world, thanks a lot for your help :) – premsh Jan 25 '12 at 1:35

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.