SAP HANA Calculation View Tutorial
SAP HANA Calculation View Tutorial
Tutorial
Ryan Bennett December 29, 2022
SAP HANA Analytic view measure can be selected from only one fact
table. When there is need of More Fact table in information view then
calculation view come in the picture. Calculation view supports
complex calculation.
Calculation View can contain multiple measures and can be used for
multidimensional reporting or no measure which is used in list type
reporting.
In SAP HANA Analytic view, we can select a measure from one table
only.
So in this case, we can use two different analytic view for each table
and join them in calculation view.
1. Join: This node is used to join two source objects and pass the
result to the next node. The join types can be inner, left outer,
right outer and text join.Note: We can only add two source
objects to a join node.
:
2. Union: This is used to perform union all operation between
multiple sources. The source can be n number of objects.
3. Projection: This is used to select columns, filter the data and
create additional columns before we use it in next nodes like a
union, aggregation and rank.Note: We can only add one source
objects in a Projection node.
4. Aggregation: This is used to perform aggregation on specific
columns based on the selected attributes.
5. Rank: This is the exact replacement for RANK function in SQL.
We can define the partition and order by clause based on the
requirement.
STEP 2)
STEP 3) Click on Join_1 node under aggregation and you can see
the detail section is displayed.
CE_COLUMN_TABLE
CE_JOIN_VIEW
CE_OLAP_VIEW
:
CE_CALC_VIEW
Query
SQL Query CE-Build in Function
Name
Select
Query On SELECT C, D From CE_COLUMN_TABLE(“COLUMN_TABLE”,
Column “COLUMN_TABLE”. [C,D])
Table
Select
Query On SELECT C, D From CE_JOIN_VIEW(“ATTRIBUTE_VIEW”,
:
Attribute “ATTRIBUTE_VIEW” [C,D])
View
Select SELECT C, D, SUM(E)
Query on From
CE_OLAP_VIEW(“ANALYTIC_VIEW”,[C,D])
Analytic “ANALYTIC_VIEW”
View Group By C,D
Select SELECT C, D, SUM(E)
Query on From CE_CALC_VIEW(“CALCULATION_VIEW”,
Calculation “CALCULATION_VIEW” [C,D])
View Group By C,D
SELECT C, D, SUM(E)
Var1=
Where From
CE_COLUMN_TABLE(“COLUMN_TABLE”);
Having “ANALYTIC_VIEW”
CE_PROJECTION(:var1,[C,D],”C” =”value”/
Where C = ‘value’
: