SAP HANA Studio, Build A Calculation View and View The Data in MS Excel
SAP HANA Studio, Build A Calculation View and View The Data in MS Excel
Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner
Tutorial Navigator /
About
About
Tutorial
SAP HANA Studio, Build a Calculation View and View the Data in MS
Excel
0%
1 2 3 4 5 6
Details
In this tutorial, you will go through all the steps to import data
from a MS Excel Spreadsheet, model a simple Calculation
view and viewing the results in a pivot table using the HANA
MDX connector.
In this tutorial, you will go through all the steps to import data
from a MS Excel Spreadsheet, model a simple Calculation
view and view the results in a pivot table using the HANA MDX
connector from MS Excel. You will rst create the basic setup
within an XS Project.
1
Step 1: Download and
Install SAP HANA
Client
First, you will need to download and install the SAP HANA
Client to enable the MDX Connector. You can nd it in the
Marketplace, in the SAP Software Download Center:
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 1/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
2
Step 2: Create the XS
Project and Core Data
Services artifacts
In SAP HANA Studio, from the SAP HANA Development
perspective, create an XS Project by selecting File->New-
>XS Project. If you do not see the XS Project option, go into
Other and look for it under the Application Development
menu inside SAP HANA.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 2/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Click Next, add a name for a schema and for the Data
De nition (.hdbdd) le
Copy
1 namespace mdx_parks;
2
3 @Schema : 'PARK'
4 context parks {
5
6 /**`Type` is to declare reusable field or structur
7
8 Type tyObjectID : String(8);
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 3/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
9 Type tyParkID : String(7);
10 Type LString : String(200);
11 Type MString : String(80);
12 Type SString : String(20);
13 Type TString : String(2);
14
15
16 /** An entity becomes a table **/
17
18 entity Park {
19
20 key OBJECTID : tyObjectID;
21 key ParkID : tyParkID;
22 ParkName : MString;
23 ParkType : SString;
24 ParkStatus : SString;
25 DevelopmentStatus: SString;
26 ParkPlanningArea : SString;
27 MgtPriorty : SString;
28 MgtAgencyName : MString;
29 MgtAgencyType : SString;
30 Landowner : MString;
31 OwnerType : SString;
32 Acreage : Decimal(10,2);
33 AcreSource : SString;
34 Address : MString;
35 CityMuni : SString;
36 County : SString;
37 State : TString;
38 StreetNum : String(6);
39 StreetDirection : TString;
40 StreetName : MString;
41 StreetType : String(4);
42 Zip : String(5);
43
44 };
45
46 /** The following fields in the file have been lef
47 StatusCmnt, Comments, Classic**/
48
49 entity Amenities {
50 key ID : String(32);
51 key ParkID : tyParkID;
52 park: Association[1] to Park on park.ParkID =
53 AmenityType : MString;
54 CourtCount : Integer;
55 DescriptionText : LargeString;
56 HasSwingset : String(5);
57
58 };
59
60
61 /**Fields Park Name, FieldCount,FieldSurface, AgeG
62 not included **/
63
64
65 };
66
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 4/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
3
Step 3: Grant
permissions to the
newly created schema
From the Systems tab, open the Security folder and look for
your user ID. Double-click on it to open your User
Administration page.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 5/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 6/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
You can now go into the Systems tab and look for the Schema
and tables:
4
Step 4: Import data
into your tables
This example uses data from the Open Data City of Boise site.
If you choose another dataset, you need to adapt the entities
and types created in the previous step to match the structure
of that dataset.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 7/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Click on Browse to select one of the two les you will import.
This example starts with
Boise_Parks_and_Reserves_Open_Data.csv, which
contains the date for the table Park. You could also start with
Boise_Parks_Amenities_Open_Data.csv, which contains
the data for the table Amenities. once you select the le,
click on Open.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 8/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Click on the Header Row Exists to indicate that the rst row
contains the names of the columns. Click on Select Table to
search for the table to which you will import the le. This
example uses the table Park.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 9/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
5
Step 5: Create a
Calculation View
You will now create a Calculation View. A calculation view can
perform complex calculations joining di erent tables,
standard views and even other calculation views as sources.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 10/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Enter the name for your calculation view and click on Finish.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 11/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Drag and drop a Join node from the Nodes bar on the left. To
connect the tables, drag and drop the circles on the top of
each Projection node into the Join node.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 12/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Add all the elds to output (except for the ParkID eld from
amenities, to prevent it from being duplicate) and set the
Join Type to Left Outer so that Parks that do not have any
amenities are also included in the results.
Finally, drag and drop the circle on the Join node into the
Aggregation node. Add all the elds in the Aggregation to
Output and click on the Semantics node.Use the Auto Assign
button to automatically set the type (measure or attribute)
for each eld.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 13/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
6
Step 6: Connect to
your instance using
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 14/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 15/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
Review the Import Data options. Keep the Pivot Table and
click on OK.
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 16/17
9/30/2018 SAP HANA Studio, Build a Calculation View and View the Data in MS Excel
You can now use Excel to execute OLAP queries against SAP
HANA and create Pivot Tables and Pivot Charts.
Next Steps
Select a tutorial from the Tutorial Navigator or the
Tutorial Catalog
https://developers.sap.com/india/tutorials/studio-view-data-calculation-mdx.html 17/17