Hierarchy Flattening Transformation in SAP BODS
Hierarchy Flattening Transformation:
Hierarchy Flattening is a readymade logic in the form of transform which is used to load Hierarchies in the table form.
- Hierarchy flattening transformation used to group the Hierarchies (master data).
- Supports only for Tree structured inputs.
- In Business Objects Data Services, Hierarchies are loaded in two fashions.
- Horizontal Flattening :
- Root to node relationship will be flattened.
- Each row in the output describes a single node and the path to the node from the root node.
- Number of records in the output will be equal to the number of nodes in the input tree.
- Enables drill up and drill down.
- Vertical Flattening :
- It takes a node and defines its relationship with all the other nodes.
- Each record of output describes a single relationship between Ancestor and Descendent and the no. of nodes the relationship includes.
- Enables global filtering – performance process.
- Input the Hierarchy Flattening transform must be a tree in the form of flat structure.
- In a Hierarchy flattening scenario, Horizontal flattening is mandatory where as Vertical flattening is optional.
Figure1 shows a sample input dataset which is a flat structure of given tree.
Figure2 shows a sample target data which is Horizontal flat structure of input dataset obtained using Hierarchy flattening transform (Horizontal fashion).
- Both Horizontal and Vertical flattening outputs have a Predefined structure which is discussed in later sections.
- Select Horizontal Flattening type for Horizontal hierarchy flattening as shown in figure 7.
- Output of the Horizontal Hierarchy flattening has a Predefined structure as in ‘Schema out’ of above figure.
- No. of levels depends on the Maximum depth of input tree.
- Select Vertical flattening type for Vertical hierarchy flattening as shown in figure 8.
- Output structure of Vertical flattening has a Predefined structure as in ‘Schema out’ of above figure.
- Use the below file as source for working out on the transformation.
- Import the below .atl file in the Data Services Designer to find the Job for Effective Date transformation.