SAP HANA Data Modeling Case Study
Step 1: Create the database tables
- Logon to the SAP HANA Studio
Start → All Programs → SAP HANA → SAP HANA Studio
- Create a database table for the customer master data
Navigator View → Catalog → GBI_XXX → Tables → Right click → New Table
Enter Table Name, Field Name, SQL Data Type and Dim (Field Length) as shown in the screenshot:
![SAP HANA Data Modeling Case Study Image 1 SAP HANA Data Modeling Case Study Image 1](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-1.jpg)
- Create a database table for the product master data
Navigator View → Catalog → GBI_XXX → Tables → Right click → New Table
Enter Table Name, Field Name, SQL Data Type and Dim (Field Length) as shown in the screenshot:
![SAP HANA Data Modeling Case Study Image 2 SAP HANA Data Modeling Case Study Image 2](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-2.jpg)
- Create a database table for the sales transaction data
Navigator View → Catalog → GBI_XXX → Tables → Right click → New Table
Enter Table Name, Field Name, SQL Data Type and Dim (Field Length) as shown in the screenshot:
![SAP HANA Data Modeling Case Study Image 3 SAP HANA Data Modeling Case Study Image 3](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-3.jpg)
Step 2: Data Provisioning
- Open the modeler perspective in the SAP HANA Studio
Window → Open Perspective → SAP HANA Modeler
- Add a new Remote Source to the SAP HANA System
Navigator View → Provisioning → Remote Sources
Right-click on Remote Sources, select “New Remote Source” and enter the data as shown in the screenshot. Please type in gbi as AccessToken.
![SAP HANA Data Modeling Case Study Image 4 SAP HANA Data Modeling Case Study Image 4](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-4.jpg)
- Add virtual Data Tables to the SAP HANA System
Navigator View → Provisioning → Remote Sources → <Source Name>
Right-click on the Customer.csv table and select “Add as virtual table”. Add “VT_” as prefix of the table name, select your Database Schema and click on create:
![SAP HANA Data Modeling Case Study Image 5 SAP HANA Data Modeling Case Study Image 5](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-5.jpg)
Repeat this step for the Product.csv and Salesdata.csv file:
![SAP HANA Data Modeling Case Study Image 6 SAP HANA Data Modeling Case Study Image 6](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-6.jpg)
- Create a new Repository Workspace for the SAP HANA System
First, switch to the SAP HANA Development Perspective:
Window → Open Perspective → SAP HANA Development
Afterwards, right-click within the Project Explorer and navigate to the following path:
New → Other → SAP HANA → Repository Workspace
There, select your system and determine a Workspace Name and Root:
![SAP HANA Data Modeling Case Study Image 7 SAP HANA Data Modeling Case Study Image 7](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-7.jpg)
- Create a new Repository Package within your Repository Workspace
Within the Repository View, right click on your Repository Workspace and navigate to
New → Repository Package
![SAP HANA Data Modeling Case Study Image 8 SAP HANA Data Modeling Case Study Image 8](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-8.jpg)
There, specify a Repository Package Name and click on Finish:
![SAP HANA Data Modeling Case Study Image 9 SAP HANA Data Modeling Case Study Image 9](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-9.jpg)
- Within your Repository Package, create a new Flowgraph Model
Right-click on your newly created Repository Package and select
New → Other → SAP HANA → Database Development → Flowgraph Model
There, enter a name, select “Flowgraph for Activation as Task Plan” and click on Finish:
![SAP HANA Data Modeling Case Study Image 10 SAP HANA Data Modeling Case Study Image 10](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-10.jpg)
After the Loading process finished, right-click on the initially empty flow graph, select “Properties” and there, change the Target Schema to your Schema:
![SAP HANA Data Modeling Case Study Image 11 SAP HANA Data Modeling Case Study Image 11](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-11.jpg)
- Within the Flowgraph Model, establish a data connection between the Virtual Table and the Data Table
Insert the Virtual Table “VT_Customer.csv” and the Table CUSTOMER_ATTR_XXX into the Model via Drag-and-Drop from the Table Catalog.
Determine the “VT_Customer.csv”-table as Data Source and the CUSTOMER_ATTR_XXX-Table as Data Sink.
Furthermore, create a connection between the two tables, by linking Data Source and Data Sink.
![SAP HANA Data Modeling Case Study Image 12 SAP HANA Data Modeling Case Study Image 12](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-12.jpg)
Next, right-click on the connection line and select “Properties”:
![SAP HANA Data Modeling Case Study Image 13 SAP HANA Data Modeling Case Study Image 13](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-13.jpg)
There, perform the field mapping between the virtual table and the data table, by linking the corresponding fields:
![SAP HANA Data Modeling Case Study Image 14 SAP HANA Data Modeling Case Study Image 14](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-14.jpg)
Afterwards, save and activate the Flowgraph Model.
- Execute the Flowgraph Model to load the customer data
In the upper right corner, click on “Open in SQL Editor”:
![SAP HANA Data Modeling Case Study Image 15 SAP HANA Data Modeling Case Study Image 15](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-15.jpg)
There, remove the leading dot before the package name and run the command:
![SAP HANA Data Modeling Case Study Image 16 SAP HANA Data Modeling Case Study Image 16](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-16.jpg)
You can check the successful execution by viewing the content of the table CUSTOMER_ATTR_XXX:
![SAP HANA Data Modeling Case Study Image 17 SAP HANA Data Modeling Case Study Image 17](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-17.jpg)
- Within your project, create a Flowgraph Model for the product data, and load the data. Perform the same steps as you did for the customer data.
Perform the steps 2.6 to 2.8 for the product data.
After performing the steps successfully, the data in table PRODUCT_ATTR_XXX should look as shown in the screenshot below.
![SAP HANA Data Modeling Case Study Image 18 SAP HANA Data Modeling Case Study Image 18](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-18.jpg)
- Within your project, create a Flowgraph Model for the sales data, and load the data. Perform the same steps as you did for the customer data.
Perform the steps 2.6 to 2.8 for the sales data.
After performing the steps successfully, the data in table SALES_XXX should look as shown in the screenshot below.
![SAP HANA Data Modeling Case Study Image 19 SAP HANA Data Modeling Case Study Image 19](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-19.jpg)
- Open the Modeler perspective in the SAP HANA Studio
Step 3: Create an Attribute View for customer data
Window → Open Perspective → Modeler
- Create a new package to group the views that you will create in the following steps
Navigator View → Content → Right click → New → Package
![SAP HANA Data Modeling Case Study Image 20 SAP HANA Data Modeling Case Study Image 20](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-20.jpg)
- In your package, create an attribute view for the customer data
Navigator View → Content → Package xx.student_xxx→ Right click → New → Attribute View…
![SAP HANA Data Modeling Case Study Image 21 SAP HANA Data Modeling Case Study Image 21](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-21.jpg)
![SAP HANA Data Modeling Case Study Image 22 SAP HANA Data Modeling Case Study Image 22](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-22.jpg)
![SAP HANA Data Modeling Case Study Image 23 SAP HANA Data Modeling Case Study Image 23](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-23.jpg)
![SAP HANA Data Modeling Case Study Image 24 SAP HANA Data Modeling Case Study Image 24](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-24.jpg)
![SAP HANA Data Modeling Case Study Image 25 SAP HANA Data Modeling Case Study Image 25](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-25.jpg)
- Join the table GBI_DEMO_COUNTRY with table CUSTOMER_ATTR_XXX using a text join
Drag & drop the field CUSTOMER_ATTR_XXX.COUNTRY to field GBI_DEMO_COUNTRY.COUNTRY.
![SAP HANA Data Modeling Case Study Image 26 SAP HANA Data Modeling Case Study Image 26](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-26.jpg)
Click on the link between the two tables that represents the join. Now you should see the properties of the join on the right.
Adjust the properties as following:
![SAP HANA Data Modeling Case Study Image 27 SAP HANA Data Modeling Case Study Image 27](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-27.jpg)
- Join the table GBI_DEMO_SALESORG with table CUSTOMER_ATTR_XXX using a text join
Drag & drop the field SALES_ORGANIZATION from the customer table to field SALES_ORGANIZATION of table GBI_DEMO_SALESORG.
![SAP HANA Data Modeling Case Study Image 28 SAP HANA Data Modeling Case Study Image 28](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-28.jpg)
Click on the link between the two tables that represents the join. Now you should see the properties view for the join in the bottom.
Adjust the properties as following:
![SAP HANA Data Modeling Case Study Image 29 SAP HANA Data Modeling Case Study Image 29](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-29.jpg)
- The view should show only current customers. For current customers, the valid-to date is equal to 9999-12-31. Add a corresponding filter to your view.
Select the VALID_TO field in the customer table.
Select the option Apply Filter in the context menu if this field.
![SAP HANA Data Modeling Case Study Image 30 SAP HANA Data Modeling Case Study Image 30](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-30.jpg)
- Add all attributes that should be visible in this view to the output structure
Select the table fields that should be visible in the output structure.
Click on Add To Output.
![SAP HANA Data Modeling Case Study Image 31 SAP HANA Data Modeling Case Study Image 31](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-31.jpg)
Now the fields should be visible in the output structure.
![SAP HANA Data Modeling Case Study Image 32 SAP HANA Data Modeling Case Study Image 32](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-32.jpg)
Repeat this for each table field that should be visible in the output structure. Select True for the property Key Attribute to mark an attribute as a key.
- Perform the description mapping for the fields COUNTRY and SALES_ORGANISATION in the properties of the output structure
Add the description fields Short Text for both tables to the Output structure.
![SAP HANA Data Modeling Case Study Image 33 SAP HANA Data Modeling Case Study Image 33](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-33.jpg)
After adding the description fields to the output, click on the output fields of COUNTRY and SALES_ORGANISATION and set the Label Column to Short Text.
![SAP HANA Data Modeling Case Study Image 34 SAP HANA Data Modeling Case Study Image 34](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-34.jpg)
Rename the output fields with the names SHORT_TEXT and SHORT_TEXT_1 to COUNTRY.description and SALES_ORGANISATION.description.
![SAP HANA Data Modeling Case Study Image 35 SAP HANA Data Modeling Case Study Image 35](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-35.jpg)
- Save, validate and activate the Attribute View
Press Save and Validate.
![SAP HANA Data Modeling Case Study Image 36 SAP HANA Data Modeling Case Study Image 36](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-36.jpg)
Check the Job Log. In case of an error, the job is highlighted in red.
![SAP HANA Data Modeling Case Study Image 37 SAP HANA Data Modeling Case Study Image 37](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-37.jpg)
Press Save and Activate.
![SAP HANA Data Modeling Case Study Image 38 SAP HANA Data Modeling Case Study Image 38](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-38.jpg)
Check the Job Log. In case of an error, the job is highlighted in red.
![SAP HANA Data Modeling Case Study Image 39 SAP HANA Data Modeling Case Study Image 39](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-39.jpg)
Step 4: Create an Attribute View for product data
- Create a new Attribute View for product data in your package
Navigator View → Content → Package xx.student_xxx → Right click → New → Attribute View…
![SAP HANA Data Modeling Case Study Image 40 SAP HANA Data Modeling Case Study Image 40](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-40.jpg)
![SAP HANA Data Modeling Case Study Image 41 SAP HANA Data Modeling Case Study Image 41](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-41.jpg)
- Add all relevant attributes to the output structure of the Attribute View
Select the table field that should be visible in the output structure as attribute.
Click on Add To Output.
After adding all relevant fields, the output structure should look as following:
![SAP HANA Data Modeling Case Study Image 42 SAP HANA Data Modeling Case Study Image 42](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-42.jpg)
- Save, validate and activate your Attribute View
Press Save and Validate.
![SAP HANA Data Modeling Case Study Image 43 SAP HANA Data Modeling Case Study Image 43](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-43.jpg)
Check the Job Log. In case of an error, the job is highlighted in red.
![SAP HANA Data Modeling Case Study Image 45 SAP HANA Data Modeling Case Study Image 44](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-44.jpg)
Press Save and Activate.
![SAP HANA Data Modeling Case Study Image 45 SAP HANA Data Modeling Case Study Image 45](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-45.jpg)
Check the Job Log. In case of an error, the job is highlighted in red.
![SAP HANA Data Modeling Case Study Image 46 SAP HANA Data Modeling Case Study Image 46](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-46.jpg)
- Create a new Analytic View for the sales data
Step 5: Create an Analytic View
Navigator View → Content → Package xx.student_xxx → Right click → New → Analytic View…
![SAP HANA Data Modeling Case Study Image 47 SAP HANA Data Modeling Case Study Image 47](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-47.jpg)
![SAP HANA Data Modeling Case Study Image 48 SAP HANA Data Modeling Case Study Image 48](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-48.jpg)
![SAP HANA Data Modeling Case Study Image 49 SAP HANA Data Modeling Case Study Image 49](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-49.jpg)
![SAP HANA Data Modeling Case Study Image 50 SAP HANA Data Modeling Case Study Image 50](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-50.jpg)
![SAP HANA Data Modeling Case Study Image 51 SAP HANA Data Modeling Case Study Image 51](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-51.jpg)
![SAP HANA Data Modeling Case Study Image 52 SAP HANA Data Modeling Case Study Image 52](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-52.jpg)
On the Data Foundation component, select the relevant fields of table SALES_XXX and choose Add to Output to add them to the output structure.
![SAP HANA Data Modeling Case Study Image 53 SAP HANA Data Modeling Case Study Image 53](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-53.jpg)
Select the Semantics component to change the type of the output fields.
![SAP HANA Data Modeling Case Study Image 54 SAP HANA Data Modeling Case Study Image 54](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-54.jpg)
- Join the sales table with the product and customer view, using a referential join
Switch to the Star Join component.
Drag & drop field DATAFOUNDATION.CUSTOMER_NUMBER_1 to field CUSTOMER_ATV_XXX.CUSTOMER_NUMBER.
Drag & drop field DATAFOUNDATION.PRODUCT_1 to field
PRODUCT_ATV_XXX.PRODUCT.
![SAP HANA Data Modeling Case Study Image 55 SAP HANA Data Modeling Case Study Image 55](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-55.jpg)
- Add the net sales price as calculated measure to the output structure of your Analytic View
In the output structure of the analytic view, select the folder Calculated Columns and choose New… from the context menu. Enter the details as indicated in the screenshots.
![SAP HANA Data Modeling Case Study Image 56 SAP HANA Data Modeling Case Study Image 56](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-56.jpg)
![SAP HANA Data Modeling Case Study Image 57 SAP HANA Data Modeling Case Study Image 57](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-57.jpg)
Press OK.
- Save, validate and activate the Analytic View
Press Save and Validate.
![SAP HANA Data Modeling Case Study Image 58 SAP HANA Data Modeling Case Study Image 58](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-58.jpg)
Press Save and Activate.
![SAP HANA Data Modeling Case Study Image 59 SAP HANA Data Modeling Case Study Image 59](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-59.jpg)
Open the data preview for your analytic view and check the data
Content → xxà GBI_XXX → Right click → Data Preview
![SAP HANA Data Modeling Case Study Image 60 SAP HANA Data Modeling Case Study Image 60](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-60.jpg)
Step 6: Analyze the sales data
- Open SAP Lumira and login with your Credentials
Start Lumira by calling the link provided by your instructor.
![SAP HANA Data Modeling Case Study Image 61 SAP HANA Data Modeling Case Study Image 61](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-61.jpg)
Type in Username and Password and click on Log on.
- Select your Analytic View as basis for your analysis
Click on your Analytic View Sales 001 (SALES_AV_001), which you have created in one of the previous tasks.
![SAP HANA Data Modeling Case Study Image 62 SAP HANA Data Modeling Case Study Image 62](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-62.jpg)
- Analyze the data provided by your Analytic View
What is the total revenue in Germany in May 2011?
- Select Revenue(SUM) in the Measures section
- Select 2011 as year
- Select 5 as month
- Select Germany as country
The correct answer is: 4.887.410,42 EUR
![SAP HANA Data Modeling Case Study Image 63 SAP HANA Data Modeling Case Study Image 63](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-63.jpg)
![SAP HANA Data Modeling Case Study Image 64 SAP HANA Data Modeling Case Study Image 64](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-64.jpg)
![SAP HANA Data Modeling Case Study Image 65 SAP HANA Data Modeling Case Study Image 65](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-65.jpg)
What are the top 3 products by revenue sold in Germany in May 2011?
- Select Revenue(SUM) in the Measures section
- Select 2011 as year
- Select 5 as month
- Select Germany as country
- Select Top 3 and Product_Name (see screenshot)
The screen should look as following:
![SAP HANA Data Modeling Case Study Image 66 SAP HANA Data Modeling Case Study Image 66](https://www.assignmenthelp.net/webimg/yah/images/questions/sap-hana-data-modeling-case-study-image-66.jpg)