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

Re: Grouping, Sorting on Aggegrated sum of the groupin

Subject: Re: Grouping, Sorting on Aggegrated sum of the groupings, for Top XX Groupings
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Mon, 13 Jun 2005 20:38:54 -0700 (PDT)
xslt grouping sorting
Hello Darin,
  I have a collection of XSLT grouping problems at -
http://gandhimukul.tripod.com/grouping.html .. Hope it
might help you ;)

Regards,
Mukul

--- Darin <darind@xxxxxxxxx> wrote:

> I am using MSXML 4.0 running on an IIS 5.0 server
> running classic ASP.
> 
> I'm trying to transform the xml below grouped by the
> Id attribute, and sort
> (descending) on the aggregated sum(Value).  I'm also
> trying to limit the
> amount of groupings to 6, where the first 5
> groupings are the highest
> aggregated sum values, and the 6th grouping is an
> aggregation of the
> remaining groups.
> 
> Here is an example of the XML:
> 
> <x>
>     <y Id="1" Name="Label" Value="2151"/>
>     <y Id="2" Name="Label1" Value="2760"/>
>     <y Id="2" Name="Label1" Value="50"/>
>     <y Id="3" Name="Label2" Value="99"/>
>     <y Id="4" Name="Label3" Value="9"/>
>     <y Id="4" Name="Label3" Value="55"/>
>     <y Id="5" Name="Label4" Value="56"/>
>     <y Id="13" Name="Label5" Value="118"/>
>     <y Id="14" Name="Label6" Value="193"/>
>     <y Id="17" Name="Label7" Value="54"/>
>     <y Id="23" Name="Label8" Value="76"/>
>     <y Id="23" Name="Label8" Value="76"/>
>     <y Id="23" Name="Label8" Value="76"/>
>     <y Id="25" Name="Label9" Value="100"/>
> </x>
> 
> I would like the xml to look like:
> 
> <x>
> <!-- Summation of the Top 5 entries aggregated sum
> (Desc) -->
>     <y Id="2" Name="Label1" Value="2810"/>
>     <y Id="1" Name="Label" Value="2151"/>
>     <y Id="23" Name="Label8" Value="228"/>
>     <y Id="14" Name="Label6" Value="193"/>
>     <y Id="13" Name="Label5" Value="118"/>
> 
> <!-- Summation of the remaining entries -->
>     <y Id="" Name="Other" Value="373"/>
> 
> <!-- <y Id="3" Name="Label2" Value="99"/>
>     <y Id="4" Name="Label3" Value="64"/>
>     <y Id="5" Name="Label4" Value="56"/>
>     <y Id="17" Name="Label7" Value="54"/>
>     <y Id="25" Name="Label9" Value="100"/> -->
> </x>
> 
> 
> I have tried to use Keys and the XPath position
> function, but with no
> success.
> 
> Thanks in an advance for any help!
> 
> Darin
> 
> 



		
__________________________________ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.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.