When building a calculation view, the SAP Business Application Studio allows you to use a feature called Data Preview to check the results. This simply launches the SAP HANA Cloud tool SAP HANA Database Explorer where your results are displayed.
You can view the SQL code that generated the results. This is a simple SQL query that selects all columns with no filters on the calculation view. You can edit the query to remove columns or add filters etc. in order to test the calculation view against different query conditions.
Watch this video to learn about the Standard Preview or Custom SQL Query.
Standard Data Preview Features
Even though the Database Explorer is not a reporting tool, it still offers analysis functionality that can be useful during modeling or troubleshooting. It is comprised of the following tabs, each offering specific capabilities:
Database Explorer Tabs
|Raw Data||All data||Basic display of contents|
|Hierarchies||Data for a Selected SQL Hierarchy||Preview of a modeled SQL hierarchy|
|Analysis||Selected attributes and measures in tables or graphs||Profiling and analysis|
Choosing the User who Executes the Data Preview
Up to SAP HANA Cloud QRC 3/2021, the data preview triggered from within the Calculation View editor (by right-clicking the up-most node, below the Semantics node) or right-clicking a design-time object in the DB module structure, was executed with a technical user ..._RT who has, by default, extensive privileges on the container's objects plus all the privileges granted to the application user in case an external schema or container is accessed.
With QRC 4/2021, from the Calculation View editor, it is possible to choose whether you want to trigger the data preview with this ..._RT user (Data Preview) or another user (Data Preview With Other Database User). This allows you to apply session contexts (client values, analytic privileges, and so on).
You must choose the other database user among the users referenced in connections defined in the Database Explorer. In particular, to query a calculation view with a standard database user, this user must be assigned to an SAP HANA Database (it is not possible to add an HDI container with another user than the ..._RT user.
You can find more information about users and security in the section Security in SAP HANA Modeling of this course.
Manual vs Automatic Data Preview Query Execution
Up to SAP HANA Cloud QRC 4/2021, upon data preview, the default query is automatically executed.
Starting with SAP HANA Cloud QRC 1/2022, a general option in Business Application Studio allows you to decide whether the query is executed automatically or needs to be triggered manually. This new option allows you to avoid the automatic execution of an expensive query during data preview, especially when you want to adapt the query before executing it.
Data Preview: SQL Hierarchies
SAP HANA Cloud QRC 1/2022 brings in a new capability for Data Preview: SQL Hierarchies modeled in a Calculation View can be visualized within Business Application Studio Data Preview.
It allows you to check easily the modeled hierarchies without using an external and/or third-party tool. You can also display and copy the SQL statement used to navigate the hierarchy.