Technical Articles
Calculation View Features of QRC2 2022
Within the time frame of 2022 QRC2, several new calculation view features have been released in SAP HANA Cloud that can be used with SAP Business Application Studio. Some of these features are highlighted below.
You can find examples that illustrate the individual features here. An overview of features of other releases can be found here.
Calculation View Snapshots
In tab “Snapshots” you can define individual queries for calculation views. Based on these queries procedures are generated that create, drop and insert into snapshot tables:
Define a snapshot query
This provides a flexible means to store results as they are at a certain point in time. The life-cycle of these procedures is controlled by the calculation view.
In addition, a calculation view can be generated to easily toggle between the online and snapshot data:
Generate Interface View
Interface View that implements constant union pruning
With snapshots you have now an easy and flexible means to serve queries that do not need online data and by this reduce resource consumption. See the modeling guide and performance guide for developers for more information.
Comments in Expressions
Use comments in expressions to better document the intention behind expressions. This will help during later refactoring and improve collaborative working.
Comments can be entered using one of the two styles:
/* comment */
-- comment
Comments in calculated columns
Comments in filter expressions
Mapping of Session Variables
Session variables can now be mapped into input parameters. This helps to re-use existing calculation views with input parameters in scenarios in which session variables should be used.
Example
Input parameter “IP_temperature” is filled by session variable “SV_temperature”


Example Query
SELECT
"SalesOrderID",
"temperature",
SUM("year") AS "year",
SUM("amount") AS "amount"
FROM "mapSessionVariable"
(placeholder."$$IP_MinimumID$$"=>'1')
GROUP BY
"SalesOrderID",
"temperature"
Results
a) Setting session variable to “old” data
SET 'SV_temperature'='old';

b) Setting session variable to “new” data:
SET 'SV_temperature'='new'

Median Aggregation

It's nice to read the venue of "MEDIAN" when a project requiring it starts very soon