xsl-list
[Top] [All Lists]

Re: [xsl] Re: Display the number of records in a group

2010-03-17 11:50:41
On 17/03/2010 16:40, David Carlisle wrote:
On 17/03/2010 16:15, anil kumar wrote:

I'm not sure what the problem was any more, but inide the for-each-group
position() goes from 1 to 8, as last() is 8 as there are 8 groups.

If you don't want the groups, just the number, you can stop after the
first and output 8, eg:


<xsl:for-each-group select="G_ROW[INTRA_EU_TRX_CODE =
('GOOD','TRIANGULATION')]"
group-by="concat(VAT_TAX_NO,BILL_CUST_NAME,INTRA_EU_TRX_CODE)">
<xsl:if test="position()=1">[<xsl:value-of select="last()"/>]</xsl:if>
</xsl:for-each-group>

or of course if you don't really need the groups at all you can just output the number of distinct grouping keys


 <xsl:value-of select="count(distinct-values(
G_ROW[INTRA_EU_TRX_CODE =('GOOD','TRIANGULATION')]/
concat(VAT_TAX_NO,BILL_CUST_NAME,INTRA_EU_TRX_CODE)))"/>


and not use for-each-group at all.

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>