Is it possible to group the whole xml document by the Customers node without hardcoding a specific customer?
and at the same time also use the following date comparison. This code below is inside a for loop which
lists every <Trade> , so no grouping is introduced. One section of the xml is listed, but there can be
many Customers and Trade nodes
<xsl:value-of select="format-number(sum(Trade/Step
[concat(substring(MinFlowDate,7),substring(MinFlowDate,1,2),substring(MinFlowDate,4,2))>=
concat(substring($global,7)+3,substring($global,1,2),substring($global,4,2))]
[concat(substring(MinFlowDate,7),substring(MinFlowDate,1,2),substring(MinFlowDate,4,2))<
concat(substring($global,7)+6,substring($global,1,2),substring($global,4,2))]
/StepCharge_TTBlack), '###,###,##0')"/>
</b></td>
structure of xml
<Portfilio>
<AsOf>11/30/2004</AsOf>
<Trade>
<TradeId>ED.TEST</TradeId>
<Customer>AAA</Customer>
<Step>
<MinFlowDate>11/30/2004</MinFlowDate>
<StepCharge_TTBlack>10</StepCharge_TTBlack>
</Step>
<Step>
<MinFlowDate>11/11/2005</MinFlowDate>
<StepCharge_TTBlack>10</StepCharge_TTBlack>
</Step>
</Trade>
<Portfilio>
Thanks,
Dmitri
-----Original Message-----
From: David Carlisle <davidc@xxxxxxxxx>
Sent: Dec 6, 2004 9:42 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: grouping and sum
> how is it possible to group by the Customer Node to retrieve a sum from StepCharge?
the sum of all StepCharge for customer AAA is
<xsl:value-of select="sum(Trade[Customer='AAA']/StepCharge)"/>
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
| Current Thread |
- grouping and sum
- dmitrik - 6 Dec 2004 14:38:51 -0000
- <Possible follow-ups>
- dmitrik - 6 Dec 2004 16:13:09 -0000 <=
- dmitrik - 6 Dec 2004 16:13:33 -0000
- dmitrik - 6 Dec 2004 18:36:34 -0000
|
|