While working on
OPT-3787, I noticed that the baseQuery for endDateReports does not exclude instances that do not have an endDate. Since the baseQuery is used to evaluate the combined instanceCount, this can lead to confusion as running instances are technically evaluated (hence count towards the combined instanceCount), but don't show up in the result of endDate reports.
In variable reports for example, we have a "missing" value bucket to account for those instances.
We should implement a solution to avoid any confusion here - either add some sort of "missing/still running" bucket to endDate reports or add a filter to the baseQuery of those reports to exclude these instances from being evaluated in the first place.
- a solution is implemented that ensures that the instance count of endDate reports is coherent with the result of the baseQuery of endDate reports, ensuring combined instance counts don't create unnecessary confusion