Solved

XSL sum help

Posted on 2015-01-19
2
147 Views
Last Modified: 2015-01-20
Using an .XSL stylesheet and the sample xml below, i would like to know how to create a sum of all values of nodes labelled ININ.Workgroup_InteractionsAnswered where interval is 'CurrentShift'  

	<Statistics>
				<IcServer name="TEST">
					<ININ.Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="Adv Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>7</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>0</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="Alle Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>7</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>0</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>3</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>40</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>40</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>17</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>20</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="MW Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>8</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>3</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>4</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>3</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>46</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>49</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>23</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>25</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="NL Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>7</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>0</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>1</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>1</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<People.WorkgroupStats_Workgroup name="Pro M Order Entry">
							<Workgroup_NumberAvailableForACDInteractions>7</Workgroup_NumberAvailableForACDInteractions>
							<Workgroup_InteractionsWaiting>0</Workgroup_InteractionsWaiting>
							<Workgroup_OnInboundACDInteractions>0</Workgroup_OnInboundACDInteractions>
							<Queue_Interval name="CurrentPeriod">
								<Workgroup_InteractionsCompleted>0</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>0</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="CurrentShift">
								<Workgroup_InteractionsCompleted>2</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>2</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousPeriod">
								<Workgroup_InteractionsCompleted>1</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>1</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousShift">
								<Workgroup_InteractionsCompleted>0</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>0</Workgroup_InteractionsAnswered>
							</Queue_Interval>
						</People.WorkgroupStats_Workgroup>
						<People.WorkgroupStats_Workgroup name="Hwes Order Entry">
							<Workgroup_NumberAvailableForACDInteractions>7</Workgroup_NumberAvailableForACDInteractions>
							<Workgroup_InteractionsWaiting>0</Workgroup_InteractionsWaiting>
							<Workgroup_OnInboundACDInteractions>1</Workgroup_OnInboundACDInteractions>
							<Queue_Interval name="CurrentPeriod">
								<Workgroup_InteractionsCompleted>2</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>2</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="CurrentShift">
								<Workgroup_InteractionsCompleted>56</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>57</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousPeriod">
								<Workgroup_InteractionsCompleted>32</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>33</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousShift">
								<Workgroup_InteractionsCompleted>0</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>0</Workgroup_InteractionsAnswered>
							</Queue_Interval>
						</People.WorkgroupStats_Workgroup>
					</Workgroup>
				</IcServer>
				<PackageName>OrderEntryXML</PackageName>
				<Description></Description>
				<Created>20150119T160407668Z</Created>
				<Message></Message>
				<MessageExpires>20150120T155819Z</MessageExpires>
			</Statistics>

Open in new window

0
Comment
Question by:juliemcnichols
2 Comments
 
LVL 18

Expert Comment

by:zc2
ID: 40558669
This should work:
<xsl:value-of select="sum(//ININ.Workgroup_InteractionsAnswered)"/>
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40558723
I think you forgot the condition

<xsl:value-of select="sum(//ININ.Queue_Interval[@name="CurrentShift"]/ININ.Workgroup_InteractionsAnswered)"/>
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Web Development Tools for MVC 3 63
Create 4 <div> below each other in php 2 47
Detect file exist or not 3 80
XSLT Help 12 20
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now