Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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 :) –  Prem Shrestha Jan 25 '12 at 1:35

Your Answer

 
discard

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.