Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
jan_zwickel
Product and Topic Expert
Product and Topic Expert
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"






Input parameter "IP_temperature" is used to filter on column "temperature"









Union pruning is implemented based on constant column "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'






By mapping session variables into input parameters the re-use of existing calculation views with input parameter becomes easier in scenarios in which session variables should be used.



Median Aggregation



Median aggregations provide statistics that are more robust against outliers than statistics such as Average. The aggregation type Median is now available for measures and calculated measures.





 
1 Comment