## 4.5.1  To include dimensions with hierarchies in an analysis
## Context
By using a data source that contains a dimension with hierarchies, you can define different views on the hierarchies of the dimension. You can also display the members of the dimension in a flat presentation.
As of step two, the steps in the following procedure are optional. You can use the options you need to define your view on the data.
## Procedure
1. Move a dimension with hierarchies to the Rows section in the design panel.
##  Note
Dimensions can also be moved to the Columns section. This procedure describes dimensions in the Rows section. Dimensions in columns behave accordingly.
The dimension is displayed in the crosstab according to the definition in the BEx Query Designer. If the dimension is defined with an active hierarchy and active attributes, the dimension is displayed in the crosstab accordingly. Nodes with a [+] contain subnodes. In the design panel, the active hierarchy and attributes are displayed in bold letters in the &lt;data source&gt; section.
Please note: If you use Analysis with Right-to-Left (RTL) languages, such as Hebrew and Arabic, the [+]/[-] signs in the sheet may work incorrectly. In this case, you can use the options in the ribbon or in the context menu to expand and collapse hierarchy nodes.
If no hierarchy is active in the query definition, the data is displayed in a flat presentation.
2. Select a different hierarchy.
Select a different hierarchy of the dimension in the &lt;data source&gt; section in the design panel and move it to the dimension in the Rows section.
Only one hierarchy of a dimension can be active at the same time.
The data in the crosstab changes according to your selection. The selected hierarchy is now active and displayed in bold letters in the &lt;data source&gt; section.
3. Activate attributes
Select an attribute of the dimension in the &lt;data source&gt; section and move it to the dimension in the Rows section.
Multiple attributes can be active at the same time.
The data in the crosstab changes according to your selection. The selected attribute is now active and displayed in bold letters in the &lt;data source&gt; section.
4. Expand/Collapse all nodes.
Select the cell with the dimension name in the crosstab and choose Hierarchy Expand to Level &lt;Level&gt; . The number of available levels depends from the hierarchy.
The levels in the crosstab are expanded according to your selection. To collapse the levels, choose the first level.
5. Expland/Collapse a single node.
Select a node cell in the crosstab that you want to expand and choose Hierarchy Expand . The selected node is expanded to the next level. To collapse the subnodes of a selected node, choose Hierarchy Collapse . Y ou can also select the [+]/[-] symbols to expand and collapse a single node.
6. Define the available levels of the hierarchy.
Select a member cell of the dimension in the crosstab and choose Hierarchy Show Level... . Select the levels that should be available in the analysis and press OK .
Only the selected levels can be displayed in the crosstab. The total is not affected by this selection because the leaf level is always available.
7. Expand the hierarchy in another direction.
By default, a hierarchy is expanded as defined in the BEx Query Designer. You can change the expansion direction for the hierarchy.
Select an element of the dimension and choose Hierarchy Expand Upwards (Rows) . Alternatively, you can expand hierarchies to columns (left or right).
The hierarchy is expanded in the selected direction.
If you use several hierarchies in a crosstab, they can be expanded in different directions.
8. Display the dimension as flat presentation.
Select the Flat Presentation node in the &lt;data source&gt; section of the design panel and move it to the dimension in the Rows section.
The hierarchy is removed from the dimension and the members of the dimension are displayed in a flat presentation.
9. Switch between hierarchical and flat presentation.
You can activate and deactivate hierarchies in the design panel to switch between hierarchical and flat presentation.
In the Rows section, choose Use Hierarchy &lt;HierarchyName&gt; For Filter Only in the context menu for an hierarchy to deactivate the hierarchy and switch to the flat presentation.
The members of the dimension are displayed in a flat presentation in the crosstab. The hierarchy information is removed in the design panel. If you open the filter dialog for this dimension, the hierarchy is still active and can be used for filtering.
To activate the hierarchy again and switch to the hierarchical presentation, choose Use Hierarchy &lt;HierarchyName&gt; For Filter Only in the context menu for the dimension.
## Results
The dimension with hierarchies is displayed according to your definition.