# Calculation logic for different hierarchies

Hi

In source module I am having Hierarchy list with 6 levels(L1,L2,L3,L4,L5,A) where A is lower level of hierarchy which is having some count line item.

In target module I am having L5 as dimension with litem as Total Count.

Scenario 1: Now we are moving A1, A2 from it's L5-1 to L5-2, where L4-1 is parent of L5-1 and L4-2 is parent of L5-2(moving out of hierarchy of L4). As parents of L5-1 and L5-2 are different then it should refer count from source module to L4-1 level in target module in Total Count line item.

Scenario 2: Now we are moving A1, A2 from it's L5-1 to L5-2, where L4-1 is parent of L5-1 and L4-2 is parent of L5-2. Also L3-1 is parent of L4-1 and L3-2 is parent of L4-2(moving out of hierarchy of L3 and L4). As L3's and L4's both are different then it should refer count from source module to L3-1 level and L4-1 level in target module in Total Count line item.

Scenario 3: Now we are moving A1, A2 from it's L5-1 to L5-2, where L4-1 is parent of L5-1 and L4-2 is parent of L5-2. L3's are same for both L4-1 and L4-2(moving out of hierarchy of L4 and not for L3). As L4's are different and L3's are same then it should refer count from source module to L4-1 level in target module in Total Count line item and it should be zero for L3-1.

Similarly it should follow the combinations for all levels(L5,L4,L3,L2,L1).

Source Module:

 Count L3-1 L4-1 L5-1 A1 80 A2 100 L3-2 L4-2 L5-2 A3 200 A4 150

Target Module:

 Total Count(Line Item) Scenario 1 Scenario 2 Scenario 3 L5-1 180 180 180 L5-1.1 0 0 0 L4-1 180 180 180 L3-1 180 0 L2-1 L1-1 L5-2 L4-2 L3-2 L2-2 L1-2

Thanks

Shirisha.

Tagged: