I currently have a dataset that looks similar to the below image:
Essentially there are cases that get opened and closed throughout the year. I was asked to make a report (really will be a bar char in the end) that summarizes the total count of cases (count of unique subscriberID's) by month and by case type.
The catch though that i am having trouble with is that they want it as a running total. So if the case was created in January of 2017 and is still open in March of 2017, they want it to still count in March of 2017. Only the month AFTER the case closes do they want it to no longer count towards a month's total.
So essentially if there were 10 open type 2 cases that happened in December of 2016 and they did not get closed in December, and no new open cases in january 2017, then January 2017 would show 10 open type 2 cases. If those same 10 cases did not get closed in January then they would show up in February section as well as adding any newly opened type 2 cases from February.
If this doesnt sound super confusing and someone has worked with something like this for, any help at all would be super appreciative. My group by knowledge is failing me pretty hard right now.
create table
script of the tables you are using as well as some dummy data and your desired output to your answer to assist us in helping you. – iamdave