Get value of immediate Parent of page selector
Hi,
The list hierarchy defined is Category > Brand > Sub-brand > SKU
When the page selector is selected, how can we dynamically get the total value of its immediate parent ?
For example,
if SKU is selected, the value should be of total of Sub-brand level.
If Brand is selected, the value should be total of Category level
The reason is to get % of total (of immediate parent) to calculate sales mix at different levels of hierarchy
Thanks.
Answers
-
To get the value associated with the parent item in a composite hierarchy, you can leverage PARENT() and a LOOKUP.
The Anapedia page on PARENT has some good examples, but here's an example of what you can do.
Module: Sub Brand Details
Dimensions: Sub Brand
Line items:
- Value = (imported)
Module: SKU Details
Dimensions: SKU
Line items:
- Value = (imported)
- Parent Item = PARENT(ITEM(SKU))
- Parent Value = 'Sub Brand Details'.Value[LOOKUP: Parent Item]
- Percent of Parent Value = Value / Parent value
You can repeat this approach for each level of the hierarchy.
Keep in mind the best practice for storing the parent values would be to put them in a System model (the 'S' in DISCO). Read more here: https://community.anaplan.com/t5/Best-Practices/Best-Practices-for-Module-Design/ta-p/35993
1