title: Xslt distinct select / Group by
body: <pre><code>&lt;statisticItems&gt;
      &lt;statisticItem id="1" frontendGroupId="2336" caseId="50264"  /&gt;
      &lt;statisticItem id="2" frontendGroupId="2336" caseId="50264"  /&gt;
      &lt;statisticItem id="3" frontendGroupId="2337" caseId="50265"  /&gt;
      &lt;statisticItem id="4" frontendGroupId="2337" caseId="50266"  /&gt;
      &lt;statisticItem id="5" frontendGroupId="2337" caseId="50266"  /&gt;
  &lt;/statisticItems&gt;
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:output method="xml" omit-xml-declaration="yes"/&gt;
  
    &lt;xsl:key name="statistic-by-frontendGroupId" match="statisticItem" use="@frontendGroupId" /&gt;
  
    &lt;xsl:for-each select="statisticItems/statisticItem[count(.|key('statistic-by-frontendGroupId', @frontendGroupId)[1]) = 1]"&gt;
         &lt;xsl:value-of select="@frontendGroupId"/&gt;
    &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>What i have done so fare is to go through all distict frontendGroupIds. What i would like to do now is to do a count of all the distict caseIds for each distict frontendGroupId but i cant seem to make that work. Can someone help me here plz?</p>