Exercise Objectives
Business Example
Overview of Exercise Tasks
Task 1: Generate Time Data in your HDI Container
Steps
Generate data for an existing time table with the following settings:
| Setting | Value |
|---|
| Calendar Type | Gregorian |
| Period Unit | Time - Day |
| Generate Data After Creation | Checked |
| From Year | 2018 |
| To Year | 2019 |
| First Day of Week | Sunday |
In your HC300_A#### project, right-click on the folder db and choose Maintain Time Tables.
In the Generate Time Data window, use the settings provided above and choose Next then Finish.
Don't forget you first need to select the check-box Time before you can choose the radio button Day. Also, you must select the check-box Generate Data After Creation.
Examine the contents of the generated source file that represents the time table.
In your HC300_A#### project, expand the generated folder time_tables and double-click on the file M_TIME_DIMENSION.hdbtable.
Check the table contents using the Database Explorer.
Open the Database Explorer and expand your container HC300_A####_HDI_CONTAINER and select Tables.
Right-click on the table M_TIME_DIMENSION and choose Open Data and you should see records covering the years 2018 and 2019. In particular, notice the granularity of the record is at the level of date and also notice the related attributes that are generated for each date, such as month, quarter, year.
Task 2: Create a Dimension Calculation View of type TIME
Steps
In your exercises folder, create a calculation view of the type time dimension using the values provided below.
| Setting | Value |
|---|
| Name | CVD_DATE_ATTRIBUTES |
| Label | Date attributes |
| Data Category | DIMENSION |
| Type | TIME |
| Calendar | Gregorian |
| Granularity | Date |
| Table | HC::M_TIME_DIMENSION |
| Auto Create | selected |
Right-click your exercises folder and choose New File.
Name the created file CVD_DATE_ATTRIBUTES.hdbcalculationview and press Enter.
Use the table above to complete the fields and press Create.
Review the generated definition of the calculation view focusing on mapping, filter expression and the hierarchy definition.
Select the Projection_1 node.
In the Projection_1 node, select the Filter Expression tab and review the filters.
Select the Semantics node.
In the Hierarchies tab, double-click the Gregorian_Hierarchy item.
Generate a root node for the hierarchy.
Expand the Properties pane.
In the Root node Visibility dropdown list, choose Add Root node.
Deploy the calculation view.
In the SAP HANA PROJECTS sub-pane, select the CVD_DATE_ATTRIBUTES calculation view.
Click on the Deploy icon.
Open SAP HANA Database Explorer and preview the data.
Go to SAP HANA Database Explorer.
Select Columns Views.
Right click on the HC::CVD_DATE_ATTRIBUTES view and choose Open Data.
Close the SQL tab without saving.
Close all remaining tabs.