Introduction To Sap Hana Modeling
Introduction To Sap Hana Modeling
RDP160
Hands-on Exercises
SAP TechEd 2013
Important: Some of the sessions use place holders for users (e.g. CD300_XX) or objects (e.g. ZCD400_Exercise_##).
The place holders XX or ## must be replaced with your assigned group number, which you find in the ‘My Reservation’
tab on the above mentioned website.
2
In this session RDP160 you have the opportunity work on several exercises that focus primarily on SAP HANA
Attribute- and Analytic Views for multidimensional reporting scenarios.
Different optional exercises have been prepared to allow you investigating advanced scenarios of your personal
interest. These also extend in making use of Calculation Views in for multidimensional reporting scenarios.
Due to time constraints during the Hands-on session, it is recommended that you first take an overview look at the
different exercises. Note, you should only work on the optional ones, if you are ahead of the timing, as the timings for
the sections are estimated without the optional exercises. Then, if at all, decide which optional ones you would like to
work through later.
Appendix ......................................................................................................................................................................... 83
ITeIO Enterprise Procurement Data Model Reference ................................................................................................. 83
3
INITIAL SETUP
During the exercises, you will work on a SAP HANA system with the following system properties:
Host name: coe-he-084.wdf.sap.corp
Instance number: 10
SAP System ID (SID): M31
Database user name: RDP160_# (# = your assigned student ID, maybe 1 or 2 digits)
Password: Welcome13
Database Schema RDP160
Student exercise package RDP160.sessionX.# (X = your assigned session number, # = student ID)
Solution package RDP160.solution
As preparatory steps, make sure a connection to the backend SAP HANA database system is defined with your
assigned user (RDP160_#).
Explanation Screenshot
Explanation Screenshot
2. Open the Modeler Perspective from the SAP
HANA Studio start screen
Explanation Screenshot
Then open
General -> Security
-> Secure Storage
Question 1: 1972
Question 2: Hoffenheim
Explanation Screenshot
And click OK.
Explanation Screenshot
4. Connect to the HANA System.
Explanation Screenshot
6. Explore the SAP HANA Database Catalog and
Repository Content structure for the Workshop
You will create an Analytic View, joining the SalesOrder data with the Dim_Customer Attribute View created in the
previous exercise.
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
6. Create the join between fact data
of the Data Foundation and the Join Defintion
Attribute Data in the Logical Join-
Node of the scenario area
Explanation Screenshot
Explanation Screenshot
Exercise 1.3 Exploring the Analytical Views with SAP Lumira (Optional)
For preview purpose, you can optionally alternatively use SAP Lumira to explore SAP HANA Analytic and Calculation
Views. SAP Lumira is a self-service solution that makes it easy to combine, manipulate, transform and visualize
business data and analysis.
Explanation Screenshot
Explanation Screenshot
Instance Number: 10
Explanation Screenshot
Note, if you choose to create a new visualization with different data, you have to go back to the step create
New Document, specify Data Source Type and connection details before you can select a different HANA View to
explore.
22
Exercise 1.4 Enhancing Attribute- and Analytic View with calculated columns
This exercise guides students how to create Attribute- and Analytic View based on existing views and how to created
calculated columns for both.
For the Customer Attribute View, we want to create a continent calculated attribute column and for the
SalesOrder Analytic View, we want to create a calculated measure for paid amounts.
Explanation Screenshot
Click Finish
As a result the Attribute View editor will
open and appear.
23
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
Type “S1EX4”
and then select the previously created
AttributeView, which is stored in your
personally assigned content package:
S1EX4_DIM_CUSTOMER.
26
Explanation Screenshot
9. Recreate the join relationship between the
existing Attribute View and the Analytic View
Data Foundation (Refer to Ex1.2 step 6).
In the details area, to create the join click
and select the ContactId column from the
DIM_CUSTOMER attribute view
and drag it
to the PartnerId column of Data Foundation.
Select the join connection. Then at the right
bottom of the editor in the property area,
change the join type property from
Referential to Left Outer.
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
5. Select columns from the Product table to be
used in the Attribute View.
Select the following columns from the
Products table:
ProductId
TypeCode
Category
NameId
DescId
SupplierId
QuantityUnit
WeightMeasure
WeightUnit
Price
Width
Depth
Height
DimensionUnit
Additionally, select the Text column from
the texts table.
Rename columns by selecting the column
in the output area and changing the name
and label in the property area below.
Explanation Screenshot
6. Specify the KeyAttribute and create a
Hierarchy for the Products Attribute View.
Explanation Screenshot
Explanation Screenshot
Exercise 2.2 Building Analytic Views with Attribute Views from multiple dimensions
This exercise guides students how to create an enhanced Attribute View, and joining Header-/Item-tables in the Data
Foundation of the Analytic View and joining with multiple Attribute Views in the Logical Join.
You will join the SalesOrder(header)- and SalesOrderItem-tables to link the SalesOrder data also to the Product
Attribute Views. Further you will additionally join with a prepared Time-Dimension Attribute View, to be able to
analyze the SalesOrder data by the Customer-, Product- and Time-Dimension.
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
36
Explanation Screenshot
3. Remodel the Data Foundation of the Analytic
View to include the SalesOrderItem table.
Explanation Screenshot
4. Remodel the Logical Join of the Analytic View
to include the Time- and the Product Attribute
Views.
Add the additional Attribute Views:
In the content tree of the SAP HANA Systems
View Drag and Drop the following Attribute
Views to the Logical Join-Node in the
scenario area of the editor:
from your personal assigned content
package the S2EX1_DIM_PRODUCT
Attribute View
From the content package tree
\RDP160\solution\shared\ the DIM_TIME
Attribute View
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
You will create Filter Variable prompts for Country and a Date Range, which multidimensional report users will be
prompted for and the processed SalesOrder Analytic View will be filtered on.
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
42
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
You will create Input Pameter prompts for Discount Percentage and a Product Category, to dynamically calculate
a discounted gross amount measure.
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
46
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
Exercise 3.2 Using HANA Unit Conversion with a Calculated Measures (Optional)
This exercise guides students how to make use of Unit Conversion to create a ShippingVolume calculated
measures, which will again make use of an Input Parameter prompt, to select the target VolumeUnit used in the
calculation.
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
Explanation Screenshot
Name: L
Description: Liters
Select > OK
51
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
Explanation Screenshot
Rename GrossAmount_1
New Name: GrossAmountUSD
New Label: GrossAmount in USD
56
Explanation Screenshot
Explanation Screenshot
.. continued specifying column conversion details:
Explanation Screenshot
Exercise 4.1 Use Temporal Joins in Analytic Views for time-dependent Attribute Mapping (Optional)
The customer status, is a time-dependent (slowly changing dimension) value, changing every quarter depending on
the previous quarters sales turnovers. In this exercise you will use temporal joins in Analytic Views to join the
SalesOrder facts time-dependently to a new Customer Status Attribute View.
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
60
Explanation Screenshot
3. Remodel the Data Foundation of the Attribute
View to include the BusinessPartnerStatus
table.
Select Data Foundation in the scenario.
Right-click on the BusinessPartner table
in the DataFoundation-node, then from the
conext menu Select > “Remove”.
Confirm the removal when prompted.
Explanation Screenshot
Explanation Screenshot
7. Define the DataFoundation of the Analytic
View.
Explanation Screenshot
8. Define the Logical Join of the Analytic View to
with the new DIM_CUSTOMER_Status and the
Dim_Time Attribute Views.
Select Logical Join in the scenario.
Add the S4EX1_DIM_CUSTOMER_STATUS
Attribute view able via drag/drop from your
content package to the Logical Join in the
scenario area of the editor:
In the content tree of the SAP HANA
Systems View Drag and Drop the following
Attribute Views to the Logical Join-Node
in the scenario area of the editor:
from your personal assigned content
package the S4EX1_DIM_CUSTOMER_STATUS
Attribute View
From the content package tree
\RDP160\solution\shared\ the DIM_TIME
Attribute View
Explanation Screenshot
Exercise 4.2 Restrict access to Analytic Views with Dynamic Modeled Analytic Privileges (optional)
This exercise guides students on how to make use of dynamic analytic privileges to dynamically restrict and filter
data, based on the end-users identity.
The following shows the analytic privilege definition and the stored procedure:
Now follow the exercise description to make use of the prepared ORGSECURITY Attribute View
Explanation Screenshot
Explanation Screenshot
Click Finish
As a result the Analytic View editor will
open and appear.
Explanation Screenshot
10. Remodel the Logical Join of the Analytic View
to include a prepared Organization Attribute
Views, used to filter data dynamically per
employee via Analytic privileges.
Add the additional Attribute View:
In the content tree of the SAP HANA Systems
View Drag and Drop the following Attribute
Views to the Logical Join-Node in the
scenario area of the editor:
From the content package tree
\RDP160\solution\shared\ the OrgSecurity-
Attribute View
Explanation Screenshot
Explanation Screenshot
Exercise Description
Create a Calculation View
Create 2 counters (Distinct count calculations)
Preview the data
Explanation Screenshot
1. Create a new calculation View
2. Give it a name
Explanation Screenshot
3. Drag and drop the Analytical
View
Explanation Screenshot
5. Add as Aggregated Column
or
or
right-click on Calculated
Columns and select New
Counter
73
Explanation Screenshot
7. Create two counters
Explanation Screenshot
7. Map the Input Parameters
Explanation Screenshot
8. Column types
Explanation Screenshot
10. Data Preview
2) Remove the 2)
countDistinctProducts and add
CountDistinctSalesOrders
Exercise Description
Create a Calculation View
Use the union to be able to combine Actual and plan data
Preview the data
Explanation Screenshot
1. Create a new calculation View
2. Give it a name
Explanation Screenshot
3. Union Node
Explanation Screenshot
5. Add the objects
Explanation Screenshot
6. Mapping in union node
Explanation Screenshot
8. We will now map the plan and
actuals net amount measures.
Explanation Screenshot
11. Prepare the Semantics
Click on Sematics and make sure
your one looks like this.
Then rename
NetAmount to ActualNetAmount
and
NetAmount_1 to PlanNetAmount
Finished!! Congratulations!!
Thank you for participating in this SAP TechEd Virtual Hands-On Workshop!
Please, take a few minutes to answer a couple of feedback questions concerning your session.
Find a shortcut to the survey on the desktop of your virtual laptop image or visit
https://www.sapsurvey.com/cgi-bin/qwebcorporate.dll?idx=FSQCZ7.
83
APPENDIX
Note: In order to browse a table, open the SAP HANA System View, open the catalog tree and the schema RDP160,
there right-click on a table and select > “Open Content” from the context menu.
© 2013 by SAP AG. All rights reserved.
SAP and the SAP logo are registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo are trademarks or
registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and the Sybase logo are registered trademarks of Sybase Inc.
Sybase is an SAP company. Crossgate is a registered trademark of Crossgate AG in Germany and other countries. Crossgate is an SAP company.