This is not a pure development- or UI-question, rather a 'behavioral' question but I don't seem to find the correct StackExchange group to post it. So please don't down-vote me if this question is not appropriate, but rather point me to the correct group.
In my application I have a hierarchical structure of items that are all the same type. E.g. departments, where departments can belong to other departments.
I also have reports that show all departments with their characteristics, e.g. the amount of work done by each department, or the revenue generated by each department.
If a department contains other departments, the values of the sub-departments should be added to the value of the department itself.
E.g. suppose that we have departments A1, A2, B1 and B2, and departments A1 and A2 belong to department A0, and departments B1 and B2 belong to department B0, and suppose they all did 100 units of work, than the report would show this:
- A0: 300
- A1: 100
- A2: 100
- B0: 300
- B1: 100
- B2: 100
Problems begin if the user decides to perform aggregations on these departments. E.g. group all departments on their last digit:
- group 0: 600
- group 1: 200
- group 2: 200
This still seems quite logical, but what if an aggregation contains both top-level departments and low-level departments. E.g. departments grouped by the nationality of the department-leader (fictional example):
- group {A0, A1, B1}: 300 (so not adding A1 and A2 to A0)? or 500 (adding A1 and A2 to A0)? or 400 (only adding A2 to A0)?
- group {B0, A2}: 200 (not adding B1 and B2 to B0)? or 500 (adding B1 and B2 to B0)?
- group {B2}: 100
Things become even more complex if the user can filter out departments (e.g. don't take departments into account that contain less than 5 people).
Of course, we could still add a configuration option to the report where the user can indicate whether he wants sub-departments to be taken into account or not, but that seems moving the problem to the user.
Are there any known articles that handle these kind of problems?

