1,495 questions
0
votes
0
answers
25
views
SQL getting cumulative sum of a table in group by where the column itself is cumulative sum
I have a table that contains column cumulative_sum which is a cumulative sum of it previous values.
So, for account A cumulative_sum for 2022-01 is 12, and for 2022-02 it's 24 meaning there has been ...
0
votes
3
answers
454
views
R terra:: cumulative sum reset function across layers of a stack
I have a stack with large number of layers, and I want to run a pixel-wise cumulative sum function across the layers with reset when sum becomes <0. Ive compiled the following code:
# given that &...
1
vote
1
answer
278
views
Get cumulative sum that reset for each year
Please consider this table:
Year Month Value YearMonth
2011 1 70 201101
2011 1 100 201101
2011 2 200 201102
2011 2 50 201102
2011 ...
0
votes
2
answers
63
views
python: cumulative density plot
I have the following dataframe:
df =
Time_to_event event
0 0 days 443
1 1 days 226
2 2 days 162
3 3 days 72
4 4 days 55
5 5 days ...
0
votes
1
answer
833
views
Cumulative total percentage in Power BI
I have a summary table in Power BI which shows how many days it takes for leads to convert to a sale. It has 2 columns, sum_convert (the amount of days in between lead creation date and converted date)...
2
votes
2
answers
747
views
How to calculate cumulative sums of ones with a reset each time a zero is encountered
I have an array made of 0 and 1. I want to calculate a cumulative sum of all consecutive 1 with a reset each time a 0 is met, using numpy as I have thousands of arrays of thousands of lines and ...
2
votes
3
answers
70
views
how to cumulative sum variable by unique values and input back in
I'm looking to do the following -- cumulative sum the indicator values and remove the indicators after those days
original:
transaction
day
indicator
1
1
0
1
2
0
1
3
0
1
4
1
1
5
1
1
6
1
2
1
0
2
2
0
2
...
-1
votes
1
answer
148
views
C# code for textbox to sum cumulative data from other textbox? (Current amount vs a running total amount)
Struggling with a C# windows form app.
I've got the form built and the basic functions (can enter the values in the form fields) and they populate a listbox properly (yay!), and the textboxes clear ...
1
vote
3
answers
484
views
RUNNING TOTAL with ARRAYFORMULA that can SUM and SUBTRACT if cell values changes
I'm trying to calculate the cumulative total in a column. It needs to sum or subtract if the value of (A) cell is set to buy or sell. here is an example:
A (task)
B (qtty)
C (total)
calculation ...
1
vote
1
answer
46
views
Running Sum of Amount Since Last eligible
I have a table with users, a month series, a flag for eligibility, a running sum of an amount, and an incremental amount column (example data below). I need to find the amount that has accumulated for ...
0
votes
0
answers
70
views
Find max of 2 series with a factor & cumulative sum on group based on condition
Trying my best to explain what I am trying to achieve here. I have 2 series (Annual Volume & Annual Capacity) which I need to compare to allocate a value in the column Allocation & then sum it ...
0
votes
2
answers
47
views
Cumulative values in R per group
So, I'm having a headache finding a way to program this in R. Since it is very easy to do Excel, I'm hoping this is just my n00b lack of knowledge.
Checking the example table I'm presenting: my ...
1
vote
1
answer
10k
views
Snowflake cumulative sum for multiple entry in same date for a given partition
I have a table with below data set. I want to get the cumulative sum based on PK1 and PK2 as on TXN_DATE. I have tried with cumulative window frame functions and its giving the expected result. But I ...
-1
votes
1
answer
319
views
Get Running Total of IDs in Presto SQL
I would like to keep a running/cumulative array of new IDs.
Starting with this:
Date
IDs_Used_Today
New_IDs
Dec 6
1, 2, 3
1, 2, 3
Dec 7
1, 4
4
Dec 8
2, 3, 4
3
Dec 9
1, 2, 3, 5
5
And getting this:
Date
...
2
votes
2
answers
2k
views
sum a Google sheets column up to current row in arrayformula
I'm trying to sum a Google sheets column up to the current row. Everything within the sum formula seems to work okay when I just use copy and paste, but it does not seem to work the same in an ...
1
vote
1
answer
85
views
Pandas group-by proportion of cumulative sum start from 0
I have the following pandas Data Frame (without 2 the last columns):
name day show-in-appointment previous-missed-appointments proportion-previous-missed
0 Jack 2020/01/01 show ...
-1
votes
2
answers
283
views
How To Calculate Running balance using SQL
If I have total qty = 100. and it has been shipped in 4 phases line 40, 10, 25, 25 that equals to 100. when I am running this query:
Someone Helped me with this query. I want the same runnable for DB2....
-1
votes
2
answers
54
views
SQL Coding to Categorize Data and Find Days Since Last Reported
UPDATE: This has been solved. I created a "calculated variable" in tableau called [Lab Volume] and put this code into the calculation:
If [Average Results Per Day] <= 25 THEN 'Low'
ELSEIF ...
1
vote
2
answers
227
views
Cumulative Sum of Repayments to calculate outstanding as on date in MySQL
I have a repayment table that looks like this below,
cus_id
due_date
principal
disbursed_date
1
01-01-2022
10
01-11-2021
1
01-02-2022
10
01-11-2021
1
01-03-2022
10
01-11-2021
2
15-03-2022
20
15-02-...
1
vote
2
answers
817
views
Running Count reset at specific condition excel
I am trying to figure out a way to reset the cumulative counting every time I reach "SI".
For example i am doing a running total of word "NO" , if there are some blanks then result ...
-2
votes
2
answers
573
views
Count consecutive row values but reset count with every 0 in row
Within a dataframe, I need to count and sum consecutive row values in column A into a new column, column B.
Starting with column A, the script would count the consecutive runs in 1s but when a 0 ...
1
vote
1
answer
569
views
Comparing two running total and changing the value of one in sql
I have looked into running total problems/questions asked here but could not find the similar one.
Im using sql developer, and have select statement privileges, do not have access to cursors or loops, ...
0
votes
1
answer
52
views
cumulative sum for each user and sorting
I'm trying to get the cumulative sum for each user.
related tables(just example):
[user]
id
nickname
A
AA
B
BB
[pointTable] user_id -> [user]id
id
user_id
point
piA
A
10
piB
B
8
[pointHistoryTable] ...
0
votes
1
answer
43
views
How to total up values from dictionary when creating a new list
Stock = {
'apple': .40,
'cheese': .90,
'banana': .60,
'pear': .60,
'steak': 3.00,
'salad': 1.00,
'ketchup': 1.00,
'wine': 5.00,
'beer': 4.50,
}
shoplist = []
for ...
1
vote
1
answer
159
views
Cumulative Sum When Order Was Placed in postgresql
I have an orders table with datetime when an order was placed, and when it was completed:
orderid
userid
price
status
createdat
doneat
1
128
100
completed
2/16/21 18:40:45
2/21/21 07:59:46
2
128
150
...