[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: using preceding-sibling to display subtotal row

Subject: RE: using preceding-sibling to display subtotal row
From: dmitrik@xxxxxxxxxxxxxx
Date: Fri, 7 Jan 2005 13:58:35 -0500 (EST)
xslt subtotal
this line gets the correct subtotal sum based on a group, so considered removing the sum and placing
in a for-each would
somehow have it display correctly in the grid. This does not work. What happens is the 
correct subtotal is displayed on each line, instead of once per group.

<xsl:value-of select="format-number(sum(../Trade[Customer= current()/Customer]/Step),'###,###,###,##0')"/></b></td>

is there a more specific grouping idea which addresses the placement of the correctly 
summed subtotal amount?

Thanks,
Dmitri





-----Original Message-----
From: Michael Kay <mike@xxxxxxxxxxxx>
Sent: Jan 7, 2005 11:12 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  using preceding-sibling to display subtotal row

> There are a list of elements, and the following code is 
> trying to create a new row to display subtotals.
> There might be any number of Customer rows. Is there a way to 
> check if I've reached the last customer, and then
> insert the subtotal row? The following code is inserting on 
> every row, instead of the last.

Sounds like a classic grouping problem - see
http://www.jenitennison.com/xslt/grouping

Don't think of this as "process all the rows, outputting a subtotal whenever
I reach the last customer in a group". Think of it as "process all the
groups; for each group, output each row in the group and then the subtotal
for the group".

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.