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

Count() on Distinct, but want to include additional c

Subject: Count() on Distinct, but want to include additional condition
From: "Ian E. Powell" <Ian.Powell@xxxxxxxxxxxxx>
Date: Wed, 10 Aug 2005 10:06:07 -0500
distinct count xsl
I am having a lil issue with a count(distinct element) situation. I am
pretty new to XSLT scripting and the issue seems rather trivial.
Generating the Unique MDBService elements works great but I also want to
include 2 counts per distinct MDBservice based upon MDBDivision.
(ie) count(  MDBService and MDBDivision = "MCAP") & count(  MDBService
and MDBDivision = "HSS")

<xsl:key name="service" match="Activity" use="MDBService"/>
.
.....

<xsl:for-each select="Facility">
	<table width="700" border="1">
	<tbody>
	<xsl:for-each select="Activity[generate-id(.) =
generate-id(key('service',MDBService)[1])]">
		<tr>
		<td>
		<xsl:value-of select="MDBService"/>
		</td>
		<td align="center" width="15%">
		<xsl:value-of select="count("based on MDBDivision =
MCAP")"/>
		</td>
		<td align="center" width="15%">
		<xsl:value-of select="count("based on MDBDivision =
HSS")"/>
		</td>
		</tr>
	</xsl:for-each>
	</tbody>
	</table>
</xsl:for-each>

XML INPUT

<Facility>
	<Name>Jefferson Memorial Hospital</Name>
	<DateRange>1/23/2005 To 7/23/2005</DateRange>
	<Activity>
		<MDBService>User Satisfaction Trending</MDBService>
		<Description>Sleep Assessment Unit, Computerized,
Respironics, Inc.</Description>
		<SendDate>2/3/2005</SendDate>
		<MDBDivision>HSS</MDBDivision>
	</Activity>
	<Activity>
		<MDBService>Price Analysis</MDBService>
		<Description>Patient Monitoring, GE Healthcare-IT
Division</Description>
		<SendDate>1/25/2005</SendDate>
		<MDBDivision>MCAP</MDBDivision>
	</Activity>
	<Activity>
		<MDBService>Price Analysis</MDBService>
		<Description>Oncology Information Management System,
Siemens Medical Solutions USA, Inc.</Description>
		<SendDate>2/2/2005</SendDate>
		<MDBDivision>HSS</MDBDivision>
	</Activity>
	<Activity>
		<MDBService>Capital Needs Assessment</MDBService>
		<Description>Analyzer, Pulmonary Function</Description>
		<SendDate>2/3/2005</SendDate>
		<MDBDivision>MCAP</MDBDivision>
	</Activity>
	<Activity>
		<MDBService>Intelligence Rep: Full</MDBService>
		<Description>Analyzer, Pulmonary Function</Description>
		<SendDate>2/3/2005</SendDate>
		<MDBDivision>HSS</MDBDivision>
	</Activity>
	<Activity>
		<MDBService>Intelligence Rep: Full</MDBService>
		<Description>Analyzer, Pulmonary Function</Description>
		<SendDate>2/3/2005</SendDate>
		<MDBDivision>MCAP</MDBDivision>
	</Activity>
</Facility>

_________________________________________________________________

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you
have received it in error, please notify the sender immediately
and delete the original. Any other use of the email by you is 
prohibited.
_________________________________________________________________

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.