Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

I need to calculate the total number of piglets born per year and quarter, grouped by cycle. The cycle can range from 1 to 9. So I would like to see this: enter image description here There are some ...
Dóra Polyák's user avatar
3 votes
2 answers
84 views

The problem: I want to distribute a value that can be positive or negative from one row into multiple rows, where each row can only contain a specific amount, if the value to distribute is positive it ...
compsciwannabe's user avatar
0 votes
0 answers
52 views

I'm trying to calculate running totals of my data, but when I change the order of the rows the field does not change to respect the sequence of data It seems that they are calculated based on original ...
Stefano's user avatar
  • 11
4 votes
1 answer
110 views

Here's some sample data import polars as pl df = pl.DataFrame( { "date": [ "2024-08-01", "2024-08-02", "2024-08-03&...
Will Gordon's user avatar
  • 3,663
0 votes
2 answers
64 views

I have a column of item costs listed top-down in order of priority that I need to purchase with $100. I would like to be able to maximize my $100 while maintaining my priority purchases as much as ...
ElizaBeso000's user avatar
6 votes
1 answer
7k views

I have a DataFrame like so: import polars as pl df = pl.from_repr(""" ┌────────────┬───────┬───────┐ │ Date ┆ Group ┆ Value │ │ --- ┆ --- ┆ --- │ │ date ┆ i64 ┆...
Syafiq Kamarul Azman's user avatar
1 vote
1 answer
76 views

I tried to find the days of supply each day. For example, date 1/23/2025 - It has inventory 700 which already subtract the forecast, 400 on that day. Count how many date of forecast can be covered by ...
Yu Ching Tsoi's user avatar
1 vote
2 answers
92 views

I have data like this where there's just two words I need to check at any time. I cant figure out how to count the duplicates but break the counting if there is another value inbetween. Column A ...
Robin's user avatar
  • 13
0 votes
1 answer
51 views

I am visualizing the % Completion for a project. The visual I've created shows two data series - one for actual % complete (Cumulative_Complete) and another for the planned % complete. The plan series ...
Vicente Garcia's user avatar
0 votes
2 answers
227 views

How do I write a formula that I can copy and paste into a column in a LibreOffice Calc spreadsheet so that each cell displays a running 7-day total of the values in a different column. Column A ...
KalleVT's user avatar
-4 votes
1 answer
156 views

I want to batch the students into maximum batch size of 100, partitioned by School. Each teacher can have 12 students. Students of any teacher should not be split into different batches. No. of ...
Sujay Salins's user avatar
0 votes
2 answers
3k views

I have clickhouse table with 3 columns: respondent, spot и weight. Data looks like this: resp, spot, weight 1, 10, 100 2, 10, 200 3, 10, 300 1, 10, 100 1, 20, 100 3, 20, 300 4, 20, 400 1, 30, 100 2, ...
Andrei Levin's user avatar
1 vote
1 answer
114 views

I have to use running total value for the parameter "users". Here is the script (simplified): with us_data as ( select count(us.*) as us_reg, count(us.*) filter (where status =...
OcMaRUS's user avatar
  • 470
92 votes
9 answers
147k views

I have a table that looks like this: id count 1 100 2 50 3 10 I want to add a new column called cumulative_sum, so the table would look like this: id count cumulative_sum 1 100 ...
Kirk Ouimet's user avatar
  • 28.6k
60 votes
6 answers
104k views

I have a table: create table Transactions(Tid int, amt int) With 5 rows: insert into Transactions (Tid, amt) values (1, 100), (2, -50), (3, 100), (4, -100), (5, 200); Desired output: TID amt ...
Pritesh's user avatar
  • 1,970
1 vote
5 answers
145 views

I first calculated monthly sum by counting IDs within a group using group-by and mutate. However, as I try to use cumsum to calculate monthly cumulative sum by group using cumsum, the data just does ...
yzhao's user avatar
  • 37
4 votes
1 answer
154 views

CREATE TABLE Emissions ( entityId VARCHAR(512), parentId VARCHAR(512), emission DECIMAL, percentContribution VARCHAR(512) ); INSERT INTO Emissions (entityId, parentId, ...
Ngo Chi Binh's user avatar
-1 votes
2 answers
94 views

I have quite a complex formula issue that I am trying to fix with excel, not sure if it's possible. Basically what I want to do is the following for my total treated patients by Product I want to do ...
Silvia González's user avatar
1 vote
1 answer
150 views

I've got a table with many columns some of these are: product_id, territory_id, quarter_num (it's a number of a quarter from 1 to 28 for instance). There are some other columns but they aren't ...
ginfonic's user avatar
1 vote
1 answer
123 views

In the following PySpark dataframe I am trying to multiply values in column top to bottom (as if I was using F.product function) but instead of row by row calculation I have subgroups of identical ...
cnns's user avatar
  • 171
1 vote
2 answers
196 views

Above is a chart I am trying to sum based on the month. Ie I want a running total that I don't have to adjust as each month changes. I know it may look a little strange but the fiscal year for us goes ...
Glen Newell's user avatar
0 votes
2 answers
60 views

Calculated column in SQL based on multiple column matches and cumsum between two tables I have two tables. Table 1: has 4 columns as shown below. X Y A( in days) B(sum) a aa 7 a bb 9 b aa 36 c dd 29 ...
One_more_time's user avatar
0 votes
2 answers
65 views

I don't know if I'm using the correct terminology, but I'm trying to find the cumulative sum of each node in a tree structure, but the children node only contribute a percentage of its cumulative sum ...
Ngo Chi Binh's user avatar
-2 votes
1 answer
44 views

I tried looking for some solution here, but still stuck. WITH MyData AS ( SELECT 'Jun 2024' AS [date], 'A' AS [group], 69 AS Supply, 0 AS Forecast UNION ALL SELECT 'Jul 2024', 'A', 61, 0 ...
Edlynn's Mumny's user avatar
0 votes
4 answers
99 views

I have a dataset like: ID DATETIME CODE Value 999 1/2/2024 16:22 TX 100 123 1/2/2024 16:47 IP 100 666 1/2/2024 17:13 IP 85 666 1/2/2024 17:38 IP 100 123 1/2/2024 18:03 ...
Captain Tyler's user avatar

1
2 3 4 5
30