I’m calculating the Month to date sales using DB2 code to compare July 2019 vs July 2018 totals. It needs to be rolling to compare the current month of data to the same month last year, otherwise I …
Tag: cumulative-sum
What is wrong with this running total (cumulative column) in Oracle select with a window function?
I have a query containing 0 or 1 in a column. For demonstration purposes I replaced the 1 with 77 so its more easy to see: select dates.d the_date , case TO_CHAR(dates.d, ‘d’) when ‘7’ then 0 when ‘1’…
Extrapolate running total from .LAST value of a BY GROUP
I trying to figure out how to create a running total, if all we have is the total sum in the .LAST variable. I created a sample dataset that should make it a little clearer what I am after: ; so, as you can see we only have data for the last time the store was in business, which includes
How to calculate running total (month to date) in SQL Server 2008
I’m trying to calculate a month-to-date total using SQL Server 2008. I’m trying to generate a month-to-date count at the level of activities and representatives. Here are the results I want to generate: From the following tables: ACTIVITIES_FACT table LU_TIME table I’m not sure how to do this: I keep running into problems with multiple-counting or aggregations not being allowed