sum

MS Access sum of related records

I have a purchase form that has a continuous subform which shows line items for that purchase. Each line item needs to include a text box that shows the sum for a number of related records in a table for that line item. (Each line item is allocated for a specific purpose(s). For instance, a line item says that 100 widgets are ordered;...

Telerik RadGrid Footer Totals For Columns, but for filtered data

Hi, I have RadGrid filled with data, implemented with sorting, paging and filtering. On filtering I get filtered set of data show in grid. In footer I have totals(sums) for a few cost columns. Problem is that when I filter data, I want to setup sums to only show sum for filtered data, not shown data or whole collection. I can't find way...

Do you know a custom tag to increment a value in a Django template?

One very annoying thing with strict MVC is that you can make the smallest processing in template. While it's usually a good practice, in this case it gets in the way: I make a for loop on a queryset of a lot of objects and display some attributes; Attributes are properties, making heavy processing (I don't want to trigger them twice). ...

to calculate sum() two alias named columns - in sql

To calculate sum() of two temp column names declared in query - in SQL stud table has only two columns m1,m2. total and total1 is given as temp name. select m1, m2, SUM(m1) + SUM(m2) as Total, SUM(m1) + SUM(m2) as Total1 from stud group by m1, m2 How to calculate grandtotal as sum(total)+sum(total1) with the col...

Awk conditional sum from a CSV file

I have a CSV file from which I would like to extract some pieces of information: for each distinct value in one colum, I would like to compute the sum of the corresponding values in another column. Eventually, I may do it in Python, but I believe there could be a simple solution using awk. This could be the CSV file: 2 1:2010-1-bla:...

Mysql query help

My system consists of two user types - Students and Tutors. - Tutors can create classes and packs - Both Students and tutors can purchase classes and packs Following are the tables involved Groups Users- Contains common fields of both user types Tutor_Details- Tutor specific fields WebClasses - Classes created by tutors Learning_...

Error CS1501: I'm not overloading a Sum() method correctly

Below is draft number 5 for my C# Homework this week. I wrote the program out using Linq first, and it worked fine. Unfortunately, the directions state that I must create my own method instead of using the wonderful Sum() method already found in Linq. The major problem with this source code is that the method overload is incorrect (and i...

How does one compute the sum of a 1D array with BLAS?

In BLAS level 1 there are *ASUM and *NRM2 that compute the L1 and L2 norms of vectors, but how does one compute the (signed) sum of a vector? There's got to be something better than filling another vector full of ones and doing a *DOT... ...

DISTINCTCOUNT with FILTERing -1 IDs

Hi, Please bear with me as I am newbie in SSAS/MDX. I want DISTINCTCOUNT measure on ID column of my fact table but after filtering -1 i.e. unknown IDs. I like to slice/dice on it as well. Here are my tables DimStudent ---------------------------- ID Name -1 Unknown 1 Joe 2 Tim 3 P...

How do I get sum of value based on same key until some point in an array?

I have an array as following. I order that array by the value of the key "attack". Everything is ok until then, but I want to get for example only 9 of that total attack values are summed up: I want to sum up 3 of key1 (3 * 45), 4 of key3 (4 * 35) and 2 of key2 (2* 25) are automatically summed up. I would be greatly appreciated if somebo...

select the sum of every client's last order

Hello, My data is as follows: ORDER_ID CLIENT_ID DATE VALUE 1881 51 2010-07-19 100.17 1882 50 2010-07-19 100.17 2754 50 2010-07-25 135.27 2756 50 2010-07-25 100.28 5514 50 2010-07-27 121.76 5515 50 2010-07-28 109.59 5516 50 2010-07-27 135...