Skip to Content
Author's profile photo Former Member

Script Based Calculation View in COPA Scenario_Part 4

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.


2.    As result following screen appears.


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.


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


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


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.


7.    Final Steps



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Rama Shankar
      Rama Shankar

      Good step by step - thanks!

      Author's profile photo Aby Jacob
      Aby Jacob

      Thanks Mahesh  🙂

      Author's profile photo Former Member
      Former Member

      Thx For nice step by step & Good Informative series of Blogs

      Author's profile photo Former Member
      Former Member

      Nicely explained.. Good job Mahesh 😉

      Author's profile photo Former Member
      Former Member

      Hi ,

      Can you please provide the query as, its not properly in the screen shot ?



      Author's profile photo Former Member
      Former Member

      Thanks a lot ... Nice work Keep it up the same sprite


      Author's profile photo Ashok Babu Kumili
      Ashok Babu Kumili

      Great Thanks for the details here.