In today’s post I will explain how to implement a hierarchy in a Calculation View in SAP Hana on time dimension fields and use it in SAP Analytics Cloud in a trend chart, which will allow us to change the level of detail in the chart without having to enter new fields.
In SAP Analytics Cloud, for trend charts we have 3 options, the surface chart, the line chart and the line chart based on a time dimension; the latter is the one we are interested in and it only supports fields of date type in date or SAP format (YYYYYMMDD).
The difference is that if we use the trend chart based on a date field without hierarchy we will be able to filter and make groupings of several months, a year or YTD (Year to Date) but always with the detail of the day since it is the field we are using.
On the other hand, if what we have is a time hierarchy and we use it in the graph, in addition to being able to make groupings, filters and thus focus on the time interval we are interested in, we can analyze the information on a daily, monthly, quarterly, annual, etc. level, taking as a reference the level of detail that we have implemented in the hierarchy.
The first thing to do is to have a calculation view in Hana where we have the time characteristics that we want to include in our hierarchy along with the rest of the fields contained in the model in question; in our example it will be year, quarter, month and day.
In Hana the steps are as follows:
- From the semantics node of the calculation view we will create a hierarchy of type level (Level Hierarchy).
- In the “Nodes” block we will configure it with as many entries as levels we need and we will associate to each type of level the corresponding field, in the example the fields and levels are:
- Year –> TIMEYEARS.
- Year Quarter –> TIMEQUARTERS
- Year Month –> TIMEMONTHS
- Day –> TIMEDAYS
- If the configuration is correct, the only thing left to do is to save and deploy or build our calculation view.
In SAP Analytics Cloud the steps are as follows:
- We will create a model based on a Live connection to an SAP Hana system. If the configuration in Hana has been successful, we should see a field in the model with the same name as the hierarchy we have previously created.