There is no simple way to calculate contributions all children levels to the highest parent level - for product levels, time levels and location levels. The lowest level should be considered the value to express as a contribution of a level you need to select.
Examples:
Week 1 to 4 belongs to Month 1, which belongs to Year 1. Need a line item with contribution function where if you select year level, shows Week 1 as a contribution of Year 1, or Month 1 as a contribution of Year 1, depending on what time level you are looking at.
Subclass 1 belongs to Class 1 belongs to Department 1 belongs to Division 1 belongs to Company. Need a line item with contribution function where if you select Company level, it shows Subclass 1 as a contribution of Company, or Class 1 as a contribution of Company, depending on what product level you are looking at.