Skip to Content

Previous Blogs in COPA Scenario.

COPA E2E Modelling Scenario in SAP HANA Part_1

COPA E2E Modelling Scenario in SAP HANA 1.0 Part_2

COPA E2E Modelling Scenario in SAP HANA Part_3

Script Based Calculation View


Calculation Views are used to create data foundation using database tables, Attribute Views, Analytic Views, and Calculation Views to address a complex business requirement. If joins are not sufficient, we create a calculation view with SQLScript. Also Calculation Views are required if the columns span across tables. A Calculation View is a composite column view visible to the reporting tools. When the view is accessed a function is implicitly executed.

Calculation views are composite views used on top of analytical and attribute views.

Calculation views are defined as either graphical views or scripted views depending on how they are created.

Graphical views can be modeled using the graphical modeling features of the SAP HANA Modeler. Scripted views are created as sequences of SQL statements.

Below are the steps for creating Script Based Calculation View 


1.    Create a Script based Calculation View.

       Right click on Calculation view > New > Calculation View.

/wp-content/uploads/2013/05/1_215081.jpg

2.    As result following screen appears.

/wp-content/uploads/2013/05/2_215082.jpg

3.    In the left side of the diagram double click on the Script Node. Before entering code into the middle section click on the structure icon within the Outputs section in the right side of the screen.

/wp-content/uploads/2013/05/3_215083.jpg

4.    Enter all the output fields accordingly, including the corresponding Data Type and Length.

/wp-content/uploads/2013/05/4_215084.jpg

5.    Write down the SQL code statements between  BEGIN & END.

/wp-content/uploads/2013/05/5_215085.jpg

6.    Click on the Output Node in the Scenario on the left hand side. Within the Script View details select all the Attributes > Right Click > Add as Attribute to            move the fields into the outputs over to the right hand side of the screen.

/wp-content/uploads/2013/05/6_215086.jpg

7.    Final Steps

Final.jpg

/wp-content/uploads/2013/05/7_215094.jpg


To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply