28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Calculation views can include measures and be used for multi-dimensional reporting or can contain no measures<br />

and used for list-type of reporting. Calculation views can either be created using a graphical editor or using a SQL<br />

editor. These various options provide maximum flexibility for the most complex and comprehensive business<br />

requirements.<br />

6.2.7 Creating Calculation Views<br />

Calculation views are used to provide composites of other views. Essentially they are based on a join or union of<br />

two or more data flows or on invoke of built-in or generic SQL functions.<br />

Calculation views are defined as either graphical views or scripted views but not as SQLScript (for exceptions, see<br />

below) depending on how they are created. They can be used in the same way as analytic views, however, in<br />

contrast to analytic views it is possible to join several fact tables in a calculation view.<br />

Graphical views can be modeled using the graphical modeling features of the <strong>SAP</strong> <strong>HANA</strong> Modeler. Scripted views<br />

are created as sequences of SQL statements.<br />

As mentioned previously calculation views are generally not created using SQLScript. There are however,<br />

exceptions to this rule. SQLScripts with the following properties can be used in calculation views:<br />

- No input parameters<br />

- Always read-only (that is, do not make changes to the database)<br />

- Side-effect free<br />

You can use calculation views to derive values and key performance indicators(KPIs).<br />

Note: The terms "attribute" and "columns" are used interchangeably in this procedure. They may denote a<br />

table column, a particular data field of a table row, or the contents of such a data field. The respective<br />

meaning should be clear from the context.<br />

Procedure<br />

1. In the Modeler perspective, expand the system node from the Navigator pane.<br />

2. Expand the Content node.<br />

3. Right-click the required package.<br />

4. From the context menu, choose New Calculation View .<br />

a. Enter a name and description.<br />

b. Select the required package.<br />

Create a Script-Based Calculation View<br />

1. Choose SQL Script.<br />

2. Select the required schema from the Default Schema dropdown list, for unqualified access in SQL.<br />

Note: If you do not select a default schema, while scripting, you need to provide fully qualified names<br />

of the objects used.<br />

3. Select the required option from the Run With dropdown list, which identifies whose rights are to be considered<br />

116<br />

while executing the calculation scenario.<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up the Analytic Model

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!