I am trying to make a histogram displaying the Turnover repartition according predefined ranges (<10%, 10-20%,....) as you can see in the attached screenshot.
I am loading excel files into one Mysql table where each line represents a project with all the financial information related to it as columns of the table.
Excel files are generated from an intranet and all projects appearing are tagged (in the intranet) to be exported in the excel file.
NORMAL SITUATION:
Normally each project should have 1 line per month (table loaded on monthly basis). So that means within the year, each project should have 12 lines.
So even if a project ends within the year, we should see lines in the table for the next months with 0 value everywhere.
ACTUAL SITUATION:
But what happening in reality is that in the source files, there are projects that ended within the year and are not appearing the next months(because when ended the projects are automatically untagged in the intraned, then will not appear in the next export and sometimes it is also happening by user mistakes).
WHAT I WANT:
In the mysql table i want to manage all these mistakes. So in the mysql table i have a column giving the "actual turnover" from beginning of the year until now and what i need is to get values in a quarter ending (march, june, september, december).
1) For the projects that are existing all over the year its OK ( i just have to pick values on march, june, sep and december, see attached excel).
2) For the projects that disapeared, i need to get the last not null value: For example a project exists for january and february then it is closed (then will not appear for all the next months, because untagged). For this specific project i need to get value for february as the value for all the next months until end of year ! (see the attached excel for projects 2 and project 4)
As said above, for all project running the whole, it is OK, but for the ones that are ending within the year i am not able to get values.