473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to get SUM of "Price" base on selected "Item"

mutanic
19
Hi Bytes,

I'm trying to get SUM of column "Price" base on selected item in column "Item". I've got no idea how to solve this without have to use sort & group function through SPD. This has to be a basic summary at the bottom of main list. I try to use $nodeset instead of $Rows but it become error. This is how I try to create the code.

Expand|Select|Wrap|Line Numbers
  1. sum($Rows/@Price[@Unit='Item1'])
This code got no error but the output is "0".

Expand|Select|Wrap|Line Numbers
  1. sum($nodeset/@Price[@Unit='Item1'])
This code got error.

So how do I use the right code for this???
Mar 22 '11 #1

✓ answered by jkmyoung

3 choices: 1. Use node-set. 2. Use XSLT 1.1. 3. Don't use a variable.
Assuming you're using XSLT 1.0 and not 1.1, since you're getting this error.

1. You have to use a (non-standard) node-set extension function in order for this to work. Depending on your environment, it might be msxsl:node-set(), where
xmlns:msxsl="urn:schemas-microsoft-com:xslt" or xmlns:exsl:node-set() where exsl="http://exslt.org/common"

1 1991
jkmyoung
2,057 Expert 2GB
3 choices: 1. Use node-set. 2. Use XSLT 1.1. 3. Don't use a variable.
Assuming you're using XSLT 1.0 and not 1.1, since you're getting this error.

1. You have to use a (non-standard) node-set extension function in order for this to work. Depending on your environment, it might be msxsl:node-set(), where
xmlns:msxsl="urn:schemas-microsoft-com:xslt" or xmlns:exsl:node-set() where exsl="http://exslt.org/common"
Mar 22 '11 #2

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

Similar topics

2
by: Steven | last post by:
Hi there, I have a list of values that I am displaying in a table (Not using a loop) I want to be able to put a graphic next to the item with the hightest price. I have all of the prices in...
1
by: Wet Basement | last post by:
I am passing data to a putcart.pl , parsing it, then building the query string to put the item in the shopping cart: $cartStr =...
1
by: Luke Dalessandro | last post by:
I have an application where there is a primary XML data file. I'll use the following as an example: <data> <item id="a"> <name>A</name> <price>$10</price> </item> <item id="b">...
13
by: - Steve - | last post by:
I've been given a school assignment and while everything else is easy there's one topic I'm completley lost on. I've been given an ASCII file that looks like this. During start-up, the program...
16
by: John Kelsey | last post by:
Back in the "old" days with C, I used to do something like... struct { char Description; float price; } Items = { {"Apple", 1.99}, {"Banana", 2.04}
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
2
by: touf | last post by:
Hi, I've the "object reference not set to an instance of an abject" error in the folowing code (initialise a datatable's rows to 0) this is hapening for the 2nd field (taxe) of the 2nd row (the...
5
by: annCooper | last post by:
Exchange Rates Source file: Exchange.cs Input file: Exchange.in Output file: Exchange.out Using money to pay for goods and services usually makes life easier, but sometimes people prefer to...
11
by: hamiltongreg | last post by:
I am new to Java and am having problems getting my program to compile correctly. My assignment is as follows; Choose a product that lends itself to an inventory (for example, products at your...
14
by: dieselxeon | last post by:
hi everyone .. I am a student and i am learning how to create form using vb but i am stuck here since this is my school project, I need someone to help me to figgure out what is wrong with my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.