?
Solved

XSL sum help

Posted on 2015-01-19
2
Medium Priority
?
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 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