Hi i know that we can find number of rows in XSLT data view web part by using this expression

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:value-of select="count($Rows[@Age])" />

Where Age is a column in the List.

Can any one help me to find out distinct number of rows in the same way. I am using XSLT 1.0 Thanks in Advance.

  • What exactly is it you want to find? The total count of rows or the total count of rows with a value in a specific column?
    – user2536
    Apr 28, 2014 at 13:33
  • I am trying to find out total number of distinct rows for a specified column in a list (Where Age is a column in the list) Apr 29, 2014 at 5:34

1 Answer 1


Finally i am able to find out answer to my problem.

This is the one that is working for me

<xsl:key match="Row" name="keyy" use="@Age"></xsl:key>
<xsl:value-of select= "count(//Rows/Row[generate-id() = generate-id(key('keyy', @Age)[1])])"/>

Where Age is a column which will be having unique values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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