2
.. i18n: Defining Hierarchy
3
.. i18n: ==================
9
.. i18n: :ref:`Hierarchy <hierarchy-link>` is the arrangements of objects, peoples etc .. in a ranked or some series. The hierarchy are the way of arranging the dimensions.
12
:ref:`Hierarchy <hierarchy-link>` is the arrangements of objects, peoples etc .. in a ranked or some series. The hierarchy are the way of arranging the dimensions.
14
.. i18n: It need the fact table.
17
It need the fact table.
19
.. i18n: Lets take the Example of Products.
22
Lets take the Example of Products.
24
.. i18n: We want our sales cube to work on the products. Means we want to see the products sold. We have divided the products in to the category. So we will make the Product Hierarchy to display products by categories.
27
We want our sales cube to work on the products. Means we want to see the products sold. We have divided the products in to the category. So we will make the Product Hierarchy to display products by categories.
29
.. i18n: Lets see the new hierarchy. According to the dimension some values are set by default like hierarchy name and dimension.
32
Lets see the new hierarchy. According to the dimension some values are set by default like hierarchy name and dimension.
34
.. i18n: .. image:: images/hier1.png
38
.. image:: images/hier1.png
41
.. i18n: We now move to define the fact table for the hierarchy. Relational column will show the all fields of the sale_order_line and sale_order. As these are the fact tables for the cube. We select product_id from sale_order_line which is related to product_prodcut
44
We now move to define the fact table for the hierarchy. Relational column will show the all fields of the sale_order_line and sale_order. As these are the fact tables for the cube. We select product_id from sale_order_line which is related to product_prodcut
46
.. i18n: .. image:: images/hier2.png
50
.. image:: images/hier2.png
53
.. i18n: We want to get the product name and the category both. We know the product_category will give category and product_template will give the name.
54
.. i18n: Now the list is filtered accordingly for adding the join tables
57
We want to get the product name and the category both. We know the product_category will give category and product_template will give the name.
58
Now the list is filtered accordingly for adding the join tables
60
.. i18n: .. image:: images/hier3.png
64
.. image:: images/hier3.png
67
.. i18n: After selecting the product_tmpl_id we move to select the category table.
70
After selecting the product_tmpl_id we move to select the category table.
72
.. i18n: .. image:: images/hier4.png
76
.. image:: images/hier4.png
79
.. i18n: So final fact table for the Product Category will be
81
.. i18n: .. image:: images/hier5.png
85
So final fact table for the Product Category will be
87
.. image:: images/hier5.png