Unioning Data in Calculation view Using Web Based Development Workbench
This blog is for for Beginner. This is the first step to Learn the Modeling in HANA.
Before we start we need to create the HANA MDC Database on HCP Trial Account.
Create a tenant database on trial landscape
- Log on to the SAP HANA Cloud Platform cockpit
- Navigate to Persistence → Databases & Schemas → Choose New.
- Enter Schema ID
- Choose HANA MDC (<trial>) option as Database System . Enter the SYSTEM User Password and Confirm Password then Choose Save.
- Database creation will take time. wait for while . ( you check the database creation progress under Events.)
- Click on “Development Tools SAP HANA Web-based Development Workbench” option. In next Tab Make the HANA Logon. Enter the Username “system” and password <”Enter the credential which you have entered in step4”>.
- In the Administration Cockpit click on “Security” option.
- Click on + sign under Granted Roles and search for “Developer”. Add the Developer Role and click on Save.
Now Navigate back to HANA Administration cockpit and Select “Editor” option.
- Create the Package “DemoUnion”.
- Provide the Package Name and Description.
- Create File “.xsaccess” under the package and click on Insert snippet.
- Create another file “.xsapp” and on Insert snippet.
- Create file “unioning.hdbschema”. Click on Insert Snippet option and change the schema name to schema_name = “Custom”;
- Create file “uniontable.hdbdd” to define the tables.
- Now Navigate to Security option and provide the access to custom created schema.
Click on save.
- Click on Catalog option.
- Go to Editor window .Click on project folder and create a new file with name unionDemo.xsodata .
Note : Without creating .xsodata file we can perform all the steps.
- Right click on the newly created .xsodata file and click on open odata explorer.
- Select TeamA1 and Click on generate data.
- Click on generate. This will generate random data in the table.
- Do the similar activity for TeamB1 to create dummy data.
- Create a calculation view . Right click on project folder and select Dimension in the data category selection box.
- Click on Union option and Add the previously created 2 tables.
- Perform the Mapping of ID , Name and Role attribute as shown in Image.
- Click on Union (Under Projection ) and map the attributes.
And finally Click on Run. You will get the Data of both the tables .
Congratulations you have done the First step of Modeling ….. 🙂