Questions tagged [sum]

The result of adding two or more quantities together.

sum
Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

Find and replace "=" for "=" until the last worksheet

I am using a code that sums values based upon the font color. It works great, but for some reason all of the equations will turn to #N/A randomly and then I have to do a find and replace "=" ...
-1 votes
1 answer
59 views

How to calculate in SQL

How to calculate in SQL SELECT NO , SUM(COST)*1.05 FROM TR WHERE NO in (SELECT NO FROM USERS) AND TR.TYPE = 'A' OR TR.TYPE = 'B' GROUP BY NO I would like to calculate the ...
0 votes
4 answers
2k views

How to generate random numbers between 1 and 60 [duplicate]

How can I do this? I know how to generate random numbers but not in a fixed range.
0 votes
0 answers
22 views

Calculate the sum of workdays until today using SQL

I have the Base Table and I am trying to get the Result Table. I am using this code to get the two first columns of the Result Table. The Overdue column should give the SUM of the WorkingDays until ...
0 votes
0 answers
19 views

How to SUM value row in javascript [duplicate]

I have table like this : +================================+==================+===========+=======+ + + the amount of fruit that has + + + Fruits ...
0 votes
0 answers
47 views

Find array indices from vector with largest sum

I have a vector with random real numbers of length 20 generated by: set.seed(100) vec1 <- runif(20) [1] 0.30776611 0.25767250 0.55232243 0.05638315 0.46854928 0.48377074 [7] 0.81240262 0....
0 votes
2 answers
63 views

Summing multiple lists [duplicate]

I have three lists that I'd like to sum. list_1 = (a1 , a2 , a3 , ... , a5184) list_2 = (b1 , b2 , b3 , ... , b5184) list_3 = (c1 , c2 , c3 , ... , c5184) I would like to sum them so that the new ...
5 votes
3 answers
25k views

How to sum the elements of N lists?

can anybody please give me a hint how to aggregate (sum up) specific elements of multiple lists? For example I have 20 lists with a similar name pattern, each representing consumption spending over ...
2 votes
1 answer
40 views

Find month have a sum greater than a given number

Link: https://docs.google.com/spreadsheets/d/11ID2mddNPeMRtPVpq16XkAUWBE4j5EK1w8Aiq7CVk6o/edit#gid=1344154694 Column C - N represent month from 1 - 12 I want to find which month have a sum greater ...
1 vote
2 answers
27 views

How to resolve digits root?

well am getting stuck with the challenge, need some explications. Thank you in Adavnce. Well, i need to make sum of numbers into an array, exp : 16 --> 1 + 6 = 7 942 --> 9 + 4 + 2 = 15 15 -...
-1 votes
1 answer
71 views

How to merge a flat array and a multidim array based on indexes and sum subarray column values?

There are two arrays: $arr1 = [ "Value1", "Value2", "Value1" ]; $arr2 = [ ["key_1" => "5", "key_2" => "10"],...
0 votes
2 answers
1k views

Longest subsequence whose sum is divisible by k [closed]

I am practicing some Dynamic Programming problems and encounter this problem Given an array of n(1<=n<=1000) integers and a positive integer k(k<=1000). Find the longest subsequence whose sum ...
1 vote
2 answers
4k views

Sum across multiple columns by row (in Stata)

I'm trying to sum the values across multiple columns (variables) for each row and store the summed values as a new column. However, my data (a Stata file) has more than 500 variables with each columns ...
0 votes
1 answer
67 views

How to make subgroups by prefixes from ICD data?

I have a large ICD-10 data and I would like to create subgroups and get a sum out of it. For example, I have 'JAL01, JAL20 and JAL21' and I would need a sum of all the codes starting with 'JAL'. How ...
0 votes
1 answer
47 views

Sum up ending with the current observation starting based on a criteria

I observe the number of purchases of (in the example below: 4) different customers on (five) different days. Now I want to create a new variable summing up the number of purchases of every single user ...
0 votes
2 answers
436 views

mysql Calculate sum IF by Group

mysql5.7 I have table below and I'm attempting to create calculated table of qty*price and distributor commissions (if total qty>100, 4% commissions, else 2%) grouped by product_name Id ...
0 votes
1 answer
214 views

How do I calculate the sum of the respective variables of a custom type array?

I am new to coding in Swift. My goal is to build a variable containing the sum of a number of custom class variables. To speak in clear terms: I have a custom class called "Entry" which has ...
0 votes
2 answers
123 views

How to divide two aggregates to get a percentage

I'm trying to calculate the percentage of volume processed versus the target volume. I've been able to calculate out the Volume Worked and the Target Volume separately, but when I try to get the ...
1 vote
1 answer
585 views

Oracle SQL - Sum next X number of Rows

I have a table in Oracle database whith projected sales per week and would like to sum the next 3 weeks for each week. Here is an example of the table for one product and what I would like to achieve ...
-2 votes
1 answer
94 views

Get an average monthly view of active members (Postgresql)

I am working with members data. I have the responsible Coach, the coachee entry, exit status and date. Because some coachees might graduate/leave during a month I want to calculate a daily number and ...
1 vote
2 answers
157 views

Google Sheets filter with OR criteria

Can someone please help me with this formula on a Google-Sheet? I am using a filter but I need to add an OR condition. =SUM(filter(H:H, A:A="completed order")) I want it to include Completed ...
-2 votes
2 answers
37 views

Display SUM of 2 listed/GROUP BY values using WHERE condition

I want to add the values of two columns displayed and display as 1 column name. This is the output I'm getting, ID Total Apple 10 RawApple 10 Mango 10 RawMango 10 I want the output ...
1 vote
1 answer
347 views

SQL Server Sum specific transaction type amounts

I have a temp table (#general) that contains Account number, transaction type, Amount info as below AccountNumber Tran_Type Credit 96551AQ6 TSCNYAEUQF 0.0000000 96551AQ6 TSCNYAEUQF ...
1 vote
0 answers
57 views

Using For Loop and Sum the Value with Case PHP

I'm not getting this right when trying to sum values based on the case. I thought it's gonna be an easy task, but it ain't the case so, please... I have an array just like these: [0] => Array ( ...
1 vote
2 answers
748 views

Sum of cells containing a formula in google sheets

I want the sum of values in a column. However I wish to ignore cells which do not contain a formula. I tried =SUMIF(A1:A10, ISFORMULA(A1:A10)) But that did not work
1 vote
1 answer
106 views

count total items, sold items (in another table reference by id) and grouped by serial number

I have a table of items in the shop, an item may have different entries with same serial number (sn) (but different ids) if the same item was bought again later on with different price (price here is ...
1 vote
1 answer
62 views

Why does summing the rows in this matrix give me 0?

I created an array A by first using the command A = [1:10]'. Then I created a 10x10 matrix, only containing 0's. I then overwrote this matrix with my A, resulting in this new matrix: A = 1 0 ...
-2 votes
1 answer
2k views

How to get the sum of two numbers in an array list?

import java.util.ArrayList; import java.util.Scanner; public class SecondPlusThird { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); ArrayList&...
1 vote
1 answer
2k views

Dataframe.sum() can only concatenate str (not "float") to str

I'm facing an issue when trying to sum a particular column in a dataframe. Why the sum function only able to concatenate str and not float? for symbol in crypto_pair: #retrieve data from ...
-1 votes
1 answer
47 views

How to add a SELECT query inside a SUM() to show a total number of comments in a forum?

I have a small forum for an intranet website. Each user can post N number of comments. I want to show the top 10 users as the ten that commented the most. I'm using MySQL. Here's what I've got: |...
0 votes
2 answers
996 views

Sum and finding the largest number in pandas using pivot tables

I got a project and want to know from more experienced users about the best way to reach the goal. Please, help a newbie) What is needed: Find the total value of the column “Metric Ton” Find the ...
0 votes
1 answer
77 views

CASE condition and SUM() common table expressions or Group By

Hope some can help ? I have a 3rd party software were i can do custom sql querys but not able to change any of the database. Struggling to get the result i would like. Do I use GROUP BY or CTE to get ...
1 vote
2 answers
340 views

Simplify google sheet formula "SUM / INDEX / MATCH"

I am trying to use google sheet to create a roster formula, to sum up the duty hour per week using INDEX/MATCH/SUM. But it's too long, is there any way to simplify the formula? Also, I realize "...
1 vote
2 answers
145 views

How can I add how much I spent in each category this month?

Im trying to track all of my expenses for this month. Im using Google Sheets and just as a small project I want to make it as automated as possible. Eventually I would want to just input the cost and ...
0 votes
2 answers
771 views

How to sum values in a loop with conditions in Xslt

I need help with something, I need transform this file, but i have this condition: when the QTY > 0 and QTY < 1, I should replace for 1 and finally sum all values I have this XML: <?xml ...
0 votes
1 answer
234 views

'Arithmetic overflow error converting expression to data type int' when left join temp tables

When trying to LEFT JOIN two temp tables I have, I'm getting the arithmetic overflow error. When doing a UNION, there's no issue, nor is there an issue when I change my SELECT statement to not use SUM ...
0 votes
1 answer
23 views

Conditional Grouping in SQL

This should be easy, but I'm having trouble with it. I have a results table that looks like this: store_id cust_id spend_ind pct 200 2 A 0.33 200 2 ...
0 votes
3 answers
76 views

Combine values from different objects in same array - javascript

i have an array that looks like this: array = [{game: 1, team: aName, score: 10 },{game: 1, team: bName, score: 1}, {game: 2, team: aName, score: 20}, {game:2, team: bName, score: 30}] i need a way ...
0 votes
1 answer
62 views

while summing of column and joining two tables returns double count

I have two table and i have performed inner joined on them: Below is my query SELECT a.ship_id AS ship_id, sum(a.qty) as total_qty from table_a as a inner join table_b on a.shp_id = b.shpid ...
1 vote
1 answer
632 views

Exclude certain records from running total (SQL) Snowflake

I have table with charges and budget. Different records could have different budget I I want NOT to increase running sum if it is greater than budget in the record. Like whenever is running sum is ...
2 votes
2 answers
5k views

Sum multiple column with PARTITION from single table

I have a question, it seems simple but I can't figure it out. I have a sample table like this: Overtime Table (OT) +----------+------------+----------+-------------+ |EmployeeId|OvertimeDate|...
0 votes
2 answers
1k views

How to sum inner property of nested observable arrays, using Angular/RXJS?

I am having trouble getting the sum (or any reduction) of an inner number property of an Observable within another Observable. I have an Observable array of "Account" objects (Observable<...
-2 votes
1 answer
263 views

normalize column data with average value of that column with awk

I have 3 columns in a data file look like below and continues up to 250 rows: 0.9967 0.7765 0.5798 0.9955 0.7742 0.5767 0.9942 0.7769 0.5734 I want to normalise each column based on the ...
0 votes
1 answer
29 views

SQL Server need the total of the previous 6 rows

I'm using SQL Server and I need to get the sum of the previous 6 rows of my table and place the results in its own column. I'm able to get the 6th row back with the below query: SELECT id ,FileSize ,...
1 vote
1 answer
55 views

how can I resize images and save them with python?

I have a image_size list saved in Tuple type. I would like to check the size of heights less than 2470 pixel and make new list file and save them. Image_size = [(800,1200), (820, 700), (850, 300), (...
0 votes
1 answer
176 views

Hiveql - Aggregating hourly data to daily

I'm very new to Hiveql and would like some help with a very simple issue. I have a table of hourly data, I've provided a simplified example below: datetimetimezone ID value 202007130000+0100 001 2 ...
1 vote
3 answers
389 views

SQL - sum operations within case when statement

I need to aggregate some sessions by day, country etc. The table has a transaction amount for each session (in local currency) and a field with the exchange_rate to EUR for the time of the transaction....
0 votes
1 answer
1k views

count sum of rows in multiple excel files using PYTHON

PART 1) I have multiple XLXS excel files saved in a folder path: File Name Row count Excel 1 10 Excel 2 20 Excel 3 10 Excel 4 10 Excel 5 5 Each XLXS file contains the SAME ...
0 votes
3 answers
130 views

Sum strings length from a txt file [duplicate]

I have txt file with names which look like that: Hans Anna Vladimir Michael Ed Susan Janice Jo I want to print the sum of all the names length: with open(r"C:\people_names.txt", "r&...
0 votes
2 answers
33 views

Split fix value to countries based on daily revenue share

DB-Fiddle CREATE TABLE sales ( id int auto_increment primary key, country VARCHAR(255), sales_date DATE, sales_volume INT, fix_costs INT ); INSERT INTO sales (country, sales_date, ...

1
90 91
92
93 94
312