Skip to Content
Technical Articles

Creating Reports via Calculation Views Using Cube – Star Joins

Introduction:

In this blog post, we will discuss on how to create reports via calculation views using cube – Star joins.

OUTPUT:

This can be achieved in three steps.

  1. Create the calculation view.
  2. Configure the destination
  3. Consume via a SAPUI5 application.

Create the calculation view:

Start the database.

Go to SAP HANA Web based development workbench.

Create a schema in the catalog.

Click on Editor in the workbench.

Right click on content and create a new application and create dummy_pkg.

Consider we have 3 tables with following data.

TABLE 1: DIMENSION TABLE

TABLE 2:

TABLE 3:

Note: Its necessary to create calculation view with dimension to have star join.

Right click on the package created and select new -> Calculation view.

Give the details as follow and click on create

Double click on the calculation view and you will find the following.

Go to projection and click on the + button to add the Data source.

Here our data source is table 1.

Select the fields and click on “Add to output”.

Save and activate it.

Thus, the calculation view for Table 1 is created.

Now to create the calculation view with star join – connect the calculation  view created above, table 2 and table 3.

Again Right click on the package created and select new -> Calculation view.

Give the details as follows

Click on projection and add the data source as table2 and Add the required fields to output.

x

Now to join these projection introduce a join in between them and connect the projections with primary key and also add the required fields to output.

Now connect the join to the star join and also by clicking on the + symbol add the Calculation view created using dimension above and map them with primary key and add the required fields to output.

Now add the measures to semantic.

Now run the calculation view created via star join.

Thus we could find the different columns from calculated view and tables are mapped inside a single view.

Now create xsodata file inorder to consume the data as service which will be consumed in a UI5 application.

Run the xsodata file and your service will be as below.

So here is our xsodata service to be consumed via UI5 application.

Configure the destination:

  • Configure the destination as follows.

Create an SAP UI5 application via sap web IDE

Click file -> new project from template and click on sap ui5 application.

Create the view as follows

Create the controller as follows

Configure the neo app.json as follows

Run the SAPUI5 Application and the output will be obtained as follows.

conclusion:

Thus, from this blog post hope you would have got a clarity on how to create calculation view using star joins. Feel free to share your views or ideas for the same.

 

Be the first to leave a comment
You must be Logged on to comment or reply to a post.