Questions tagged [cumulative-sum]

For questions regarding implementations or algorithms for calculating cumulative sums (also known as running totals). Always add the tag for the language/platform!

A cumulative sum (also known as a running total or partial sum) refers to the concept of maintaining only a single value (the sum), which is updated each time a new value is added to the sequence.

1433 questions
-3
votes
1 answer

Cumulative count in SQL

I am working on SQL and came across one scenario that needs to build in SQL. Below is scenario: PatientID AdmitDate DischargeDate 12 7/24/2017 09:45 7/24/2017 11:01 13 7/21/2016 08:37 7/22/2017 00:15 I want result set…
-3
votes
1 answer

Javascript confusion about sum values

I am developing a webpage. I need help adding plus one to the value on click. I also need help adding the price of all the items that are collected in a section in the "number of items selected" I want to add the total price of all the items in the…
-3
votes
1 answer

Trying to create a simple cumulative addition script in PHP (or JS):

Trying to create a simple cumulative addition script in PHP (or JS): 1) enter any integer(4 digits or less), click submit, number entered is displayed and saved on the same web page 2) enter another number, click submit, number entered is added…
Mark
  • 1
  • 3
-4
votes
2 answers

how to get total value returned from the input field

I'm trying to find a total value of my user inputs. to get the aggregate which multiply the number with it same value let Dem200 = document.querySelector(".input_200"); let output200 =…
-4
votes
1 answer

Why are we using currsum[n+1] and then on line no. 23 currsum[i] = currsum[i-1] + arr[i-1];?

Why is she using [n+1] instead of N directly and then that line no. 23 what is that equality? Why do we use INT_MIN for Maximum numbers or arrays, and `INT_MAX for minimum things? #include using namespace std; //Question is of…
UUC110
  • 1
  • 4
-4
votes
1 answer

how to record multiple records and keep running tally in C++

Please Note: I am advised to use arrays, functions, parameter passing to achieve my goal. Another calculator-program student in need of help...How many of these have you all seen? In all seriousness, I need to use functions and parameter passing…
-6
votes
1 answer

How to create a runing total formula that expands automatically when new rows are added to my spreadsheet

Hello right now I have a simple deposit / expense spreadsheet where I have a sum formula that does down column C adding(or subtracting) from what is put into column B. Formula is =SUM($B$1:B1) This works great for the rows that are created however…
1 2 3
95
96