473,545 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSLT- Counting value based on duplite clientID

4 New Member
Hello,
I got a question, as I'm not sure what is possible,
I'm setting up a page based on XSLT where I can see orders with Value ready to be send out to the client
I build in a function that if a order had a bigger value than 10K then a line manager has to approve,

This works,
But now the question I need to implement also a function that if 2 orders from the same client ID are above 10K that this needs to be approved,

So in short I need to create a selection on Duplicate client ID then do Total + total is $totalsum.

Now I don't have a clue where to start.

I found something which can make me start.
where I replace Surname with clientId and Firstname with total.

Expand|Select|Wrap|Line Numbers
  1. <xsl:key name="contacts-by-surname" match="contact" use="surname" />
  2. <xsl:template match="records">
  3.     <xsl:for-each select="contact[count(. | key('contacts-by-surname', surname)[1]) = 1]">
  4.         <xsl:sort select="surname" />
  5.         <xsl:value-of select="surname" />,<br />
  6.         <xsl:for-each select="key('contacts-by-surname', surname)">
  7.             <xsl:sort select="forename" />
  8.             <xsl:value-of select="forename" /> (<xsl:value-of select="title" />)<br />
  9.         </xsl:for-each>
  10.     </xsl:for-each>
  11. </xsl:template>
  12.  
But is this a right approach, I don't ask you to write a script, only advise me on a direction How To :).

Thanks Richard
Aug 15 '14 #1
0 2667

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3889
by: Lizard | last post by:
OK, total newbie here, so this may be a mind-numbingly dumb question AND I may be phrasing it badly. I have an xsl:template which looks like this: <xsl:template match="LoanRecord"> <hr> <xsl:number count="LoanRecord" format="1"/><br/> Loan ID:<xsl:value-of select="loan_no"> </xsl:value-of><br/> Calculated CLTV:<xsl:value-of...
1
4028
by: Richard G. | last post by:
Hi All, I am newbie in XML. I am designing a dynamic menu and retrieving data from xml. I have the xml file something like this: <?xml version="1.0" ?> <ROOT>
1
2140
by: TRAX | last post by:
Here's my problem: I've got a table cities with the following tables: zipcode, city, province and table provinces: a table with: province_id, provincename cities.province and province.province_id are linked. Is there anay way to automatically fill in the cities.province value based on the cities.zipcode value? For example: if the value in...
11
2363
by: garyusenet | last post by:
I have 'cli via c# on order', and in the mean time am reading 'Pro C# 2005 and the .NET platform' (Andrew Troelson). I'm just reading about the 'five types defined in the CTS'. Specifically Struct. Now Troelson described the struct type as 'a lightweight class type having value based semantics'. Looking at his example I cant see any...
3
1528
by: ajaypaidi | last post by:
HI gurus, i need to select a value based upon 2 columns.for instance,i have table A and Table B where Table A has 2,3,4,5 values and Table B has D,E,F,G,H,I,J,K L,M which is related to Table A in such a way that 2-Dand 3-E,F,Gand 4-H,I,J and 5-K,L,M. i need to select a value in Table B where Table A value is 2.thanks in advance
0
2459
by: mervyn | last post by:
Hi There, I am very new to .NET and VB so this may be a really simple thing to solve but here is my issue I have a a textbox with a value in it. I know what the length of the text in the text box is. I would then like to set the width of the text box (in px) to an appropriate calculated value based on the length. So, if the text length is...
2
1708
by: jbaranski | last post by:
I have spent several days attempting to accomplish a certain task but am truly no closer than I was near the beginning. i need to return a single value based on an employees payment option; whether they use Direct Deposit, physical check or both. Each payment type resides in a seperate record, but here's the kicker; if an employee only get's...
1
1396
by: Naisargi | last post by:
A c++ prog to enter an integer & print its total value based on followin formula x-1/3!*3+1/5!*5-1/7!*7+1/9!*9
1
1677
by: BaseballGraphs | last post by:
Hello, I am requiring some assistance in creating a function that will be able to look up and return a value based on an ID using javascript. I am having a user click a checkbox and the checkbox takes this structure: <input type="checkbox" value="<?= $statistic_id; ?>" name="<?= $statistic_id; ?>" id="checkbox_data" <?= $i==0 ?...
4
1730
by: mcupito | last post by:
I am creating payouts, that can increase or decrease in value based on their NetAssetValue, which is determined each quarter. I have a Payroll Request table and NAV table. I am trying to update each record in the payroll request table with the most recently entered NetAssetValue. Now, I have a query that gets just that, however it appears it...
0
7479
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7411
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.