Technical Articles
Calculation View Features of SAP HANA 2.0 SPS07
With the release of SAP Web IDE SPS07 and HANA 2.0 SPS07, new features in the area of calculation view modeling will become available that had only been released in SAP HANA Cloud before.
Below is a short description of newly released features. For examples of the individual features have a look at the respective project “SPS07_Selected_Calculation_View_Modeling_Features” that can be found here.
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
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 the results of a query 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 online and snapshot data:
Generate Interface View
Interface View that implements constant union pruning
With snapshots an easy and flexible option exists to reduce resource consumption and to speed up queries if slightly outdated data are acceptable. See the modeling guide and performance guide for developers for more information.
Median Aggregation

Mask columns based on session user
Masking of columns can be done based on the user who is calling the calculation view which contains the mask definition or based on the session user which is running the SQL query.
In a stacked scenario, the calling user will be the owner of the including calculation view while the session user will be the user who runs the SQL query.
To switch between the different modes, use the view-global setting Mask Mode:
session user masking
With the new option to mask based on the session user, masking in stacked scenarios becomes significantly easier.
System-Versioned and Application-Time Tables
When using system-versioned or application time-period tables in calculation views, the resulting data can be filtered by certain timestamps or time periods. The relevant selection criteria can be defined for each individual data source using constants, expressions, or input parameters.
This simplifies time-traveling analytics with focus on data as of a certain time-point or period.
example of Temporal Source setting

Fill time tables using SQL statements

CREATE SCHEMA TIMEDATA;
CALL SYS.UPDATE_TIME_DIMENSION('DAY',2018,2025,0,'TIMEDATA','DAY_GRANULARITY_2018_2025',?);
A similar procedure can be used to fill the fiscal calendar: SYS.UPDATE_FISCAL_CALENDAR.
Hi Jan,
Many thanks for this blog post, these are really cool new features! In the past I had to implement the snapshots manually using HANA flowgraphs. I published this blog post in November 2021. Now they can be implemented in this new way, much easier and more flexible. I am looking forward to testing it!
Kind regards,
Carlos
Hi Carlos,
sounds interesting. Thanks for sharing! Let me know about your experiences.
Best,
Jan
P.S. The .hdbschedulerjob might be also interesting in this context for you.
Wonderful blog, Thanks for sharing, I am able understand everything other than these 2 "calculation view snapshots" and "Column masking", if possible can you elaborate these 2 points more with some real examples.
Also, what is the difference between.hdbschedulerjob and .xsjob why to use this .hdbschedulerjob when i can do the same thing using .xsjob?
Thanks for your interest!
You can find descriptions and examples by clicking the link at the beginning of the blog. Following the folder structure to the SPS07 features will guide you to examples.
In addition, you can find more details about calculation view snapshots e.g., in the developer performance guide and the modeling guide.
Information about column masking can also be found in the modeling guide
The hdbschedulerjob is a database artifact that you can manage within your HDI container. Having the schedule description and the snapshot calculation view in the same HDI container can make lifecycle management easier. The .xsjob relies on the XS framework instead. Please keep in mind that XS classic is deprecated and have a look at the XS Advanced job scheduler.