Calc View Star Join PDF
Calc View Star Join PDF
Calc View Star Join PDF
PUBLIC
Warning
This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 1/74
1/10/2020
Calculation views are mainly used for analyzing operational data marts or running multidimensional reports on revenue,
pro tability, and more. Calculation views consume various combinations of content data (that is, non-metadata) to model a
business use case. You can classify content data as:
Measures: Quanti able data - such as revenue, quantity sold, and counters.
Calculation views simulate entities (such as customer, product, sales, and more) and their relationships. Data visualization and
analysis applications such as SAP BusinessObjects Explorer and Microsoft Office based reporting tools consume these calculation
views and help decision makers in their decision process.
You can create calculation views with layers of calculation logic, which include measures sourced from multiple source tables, or
advanced SQL logic, and much more. The data sources in a calculation view can include any combination of tables and calculation
views. You can create joins, unions, projections, and aggregations on data sources.
Calculation views can include measures and be used for multidimensional reporting, or can contain no measures and used for list-
type reporting. Calculation views can do the following:
Support analytic privileges (for example, restricting a user for a certain cost center).
Support SAP ERP speci c features (for example, client handling, language, currency conversion).
Support additional data processing operations (for example, Union, explicit aggregation).
Related Information
Attributes and Measures
Create Graphical Calculation Views
Preview Calculation View Output
Attributes
Attributes are the nonmeasurable analytical elements.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 2/74
1/10/2020
Simple Attributes Individual nonmeasurable analytical elements For example, PRODUCT_ID and PRODUCT_NAME are
that are derived from the data sources. attributes of product data source.
Calculated Attributes Derived from one or more existing attributes For example, deriving the full name of a customer ( rst
or constants. name and last name), assigning a constant value to an
attribute that can be used for arithmetic calculations.
Measures
Measures are measurable analytical elements that are derived from calculation views.
Calculated Measures Calculated measures are de ned based on a For example, you can use calculated measures to
combination of data from other data sources, calculate the net pro t from revenue and operational
arithmetic operators, constants, and functions. cost.
Counters Counters add a new measure to the calculation For example, to count how many times product appears
view de nition to count the distinct and use this value for reporting purposes.
occurrences of an attribute.
Related Information
Working With Attributes and Measures
Required Authorizations
The Object Owner user and the Application user by default have the authorizations that they require to model calculation views
including _SYS_BI access.
Modeling
This tables describes the authorizations required for modeling calculation views.
Object Owner
SELECT with GRANT on objects used in These authorizations are assigned
modeling. automatically for objects within the same
container. But, for objects outside the
container, the authorizations must be
granted with the .hdbgrants le.
Application User
SELECT on objects used in modeling SELECT on objects are assigned by
default, but must be granted for objects
SELECT on schema _SYS_BI outside the container.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 3/74
1/10/2020
Reporting
For reporting purposes, users require SELECT on the calculation view, SELECT on _SYS_BI, and if applicable, even analytic
privileges. If the calculation view is used in another calculation view, then users require SELECT on the higher-level calculation
view.
Context
Graphical calculation views can bring together normalized data that are dispersed. You can combine multiple transaction tables
while creating a graphical calculation view.
Procedure
1. Start SAP Web IDE in a Web browser.
2. If you want to create a new project for the calculation view, do the following:
a. In the SAP Web IDE, choose File New Project from Template .
Currently, there is only one type of project template available, namely: Multi-Target Application Project. Select
Multi-Target Application Project and choose Next.
c. Type a name for the new MTA project (for example, myApp and choose Next to con rm).
d. Specify details of the new MTA project and choose Next to con rm.
3. Select the SAP HANA Database Module in which you want to create the calculation view.
Tip
If you do not already have a database module, right-click the root folder of your new MTA project and, in the context
menu, choose New SAP HANA Database Module .
4. Browse to the src folder, right-click it and choose New Calculation View .
6. Choose Create.
The tool launches a new graphical calculation view editor with a semantics node and a default view node. The default view
node can be an aggregation or a projection view node and depends on the data category that you have selected while
creating the calculation view. If you are creating a calculation view with star join, then the default view node is a star join
view node.
Note
You can switch between the default view nodes. For example, from a default aggregation view node to a project view
node or a star join view node. Right-click the default view node and select the required menu option.
7. Continue modeling the graphical calculation view by dragging and dropping the necessary view nodes from the tool palette
to the view editor. You can switch between any of the inner aggregation or projection view nodes by right-clicking the view
node and selecting the required menu option. The tool retains the same name after the switch operation.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 4/74
1/10/2020
8. Add data sources.
d. In the Find Data Sources dialog box, select the type of the data source.
e. Enter the name of the data source and select it from the list.
You can add one or more data sources depending on the selected view node.
f. Choose Finish.
Note
Supported data sources in view nodes in the current version.
The Find Data Sources dialog box displays multiple object types in the search result. But, depending on the
selected view node, you can only add activated (built) catalog tables, calculation views, CDS entities, CDS views,
and table functions as data sources in the view nodes.
9. (Optional) Add data sources from external services (HDI or non HDI containers).
You can use synonyms to access objects from user-de ned schemas (non HDI) or from HDI containers. The tool
automatically creates (or modi es the existing) .hdbsynonym, .hdbgrants, and .hdbsynonymconfig (for objects
in HDI), les that are necessary to consume the synonym.
Note
You can access data sources from external services only if you have created the necessary user-provided service and
con gured it in the mta.yaml le. For more information see, Add an External Service in the mta.yaml File.
c. In the External Services dropdown list, select the required external service.
d. Enter the name of the data source you want to access from the external service and select it from the search list.
You can add one or more data sources depending on the selected view node.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 5/74
1/10/2020
2. In the Application User Role, enter the name of the application user role.
For more information on roles for HDI containers, see the topic, Roles (.hdbrole) in the SAP HANA
Developer Guide (for XS Advanced).
If the object for which you are creating the synonym is in a HDI container, select Synonym for HDI
Container. This selection helps the tool identify that you are creating synonym for an object in the
HDI container.
2. In the Application User Role, enter the name of the application user role.
For more information on roles for non HDI containers, see the topic, Enable Access to Objects in a
Remote Classic Schema in the SAP HANA Developer Guide (for XS Advanced).
Note
If the object for which you are creating the synonym is in a non HDI container, ensure that you
have not selected the Synonym for HDI Container checkbox.
h. Choose Finish.
The tool creates the synonym along with the .hdbsynonym, .hdbgrants, and .hdbsynonymconfig (for
objects in HDI) les in the same SAP HANA Database Module.
b. On the Mapping tab, select the column you want to add to the output.
d. If you want to add all columns in a data source to the output, then from the context menu of the data source, select
Add To Output.
Note
Using keep ag property. The Keep Flag property on attribute columns in uence the result set. Use Keep Flag
property, for example, if you want to aggregate the measures by performing an SQL GROUP BY operation on
them, even when they are not included in the query.
iii. In the Properties section, set the value of Keep Flag property to True.
To successfully activate a calculation view with data category as CUBE, you must specify at least one column as a measure.
If the data category is set to Cube, an additional aggregation column is available to specify the aggregation type for
measures.
b. Choose Copy.
e. Choose OK.
Use the outline pane in SAP Web IDE to obtain a quick overview of the modeler objects (view nodes and columns) in the
calculation view.
The tool displays all modeler objects in the calculation view. You can also select an object in the outline pane, and
navigate to the editor to identify where the object is used in the calculation view.
b. In the right menu bar, choose (Outline) to show or hide the outline pane.
14. Choose Save on the menu bar to save your calculation view.
The build process uses the design-time database artifacts to generate the corresponding runtime objects in the database
catalog.
Next Steps
After creating a graphical calculation view, you can modify the output to your needs. The following table shows how you can
modify the calculation view.
Query data from two data sources and combine records from both the data sources, based on a Create Joins
join condition, or to obtain language-speci c data.
Partition the data for a set of partition columns, and perform an order by SQL operation on the Create Rank Nodes
partitioned data.
Execute any of the available graph operations on the graph workspace. Create Graph Nodes
Model calculation views with SAP HANA hierarchy functions. Use Hierarchy Functions
Count the number of distinct values for a set of attribute columns. Create Counters
Create new output columns and calculate their values at runtime using an expression. Create Calculated Columns
Assign semantic types to provide more meaning, and to attach information about the type of Assign Semantics
attributes and measures in calculation views.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 7/74
1/10/2020
Parameterize calculation views and execute them based on the values users provide at query Create Input Parameters
runtime.
Filter the results based on the values that users provide to attributes at runtime. Assign Variables
Create level hierarchies to organize data in reporting tools. Create Level Hierarchies
Create parent-child hierarchies to organize data in reporting tools. Create Parent-Child Hierarchies
Associate measures with currency codes and perform currency conversions. Associate Measures with Currency
Associate measures with unit of measures and perform unit conversions. Associate Measures with Unit of
Measure
De ne default values for columns (both attributes and measures) when no value is provided Handle Null Values in Columns
during a SQL INSERT operation.
Group related measures and related attributes together in a folder. Group Related Measures and Attributes
Filter the view data either using a xed client value or using a session client set for the user. Filter Data for Speci c Clients
Invalidate or remove data from the cache after speci c time intervals. Invalidate Cached Content
Execute time travel queries on calculation views. Enable Calculation Views for Time Travel
Queries
Related Information
Working With View Nodes
Preview Calculation View Output
Working With Attributes and Measures
Working With Calculation View Properties
Additional Functionality for Calculation Views
De ning Data Access Privileges
Create Graphical Calculation Views with Star Joins
Example: Using Keep Flag
Context
Star joins in calculation views help join a fact table with dimensional data. The fact table contains data that represent business
facts such as, price, discount values, number of units sold, and more. Dimension tables represent a collection of information. The
information can include entities such as, geography, time intervals, contact names and more.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 8/74
1/10/2020
Procedure
1. Start SAP Web IDE in a Web browser.
2. If you want to create a new project for the calculation view, do the following:
a. In the SAP Web IDE, choose File New Project from Template .
Currently, there is only one type of project template available, namely: Multi-Target Application Project. Select
Multi-Target Application Project and choose Next.
c. Type a name for the new MTA project (for example, myApp and choose Next to con rm).
d. Specify details of the new MTA project and choose Next to con rm.
3. Select the SAP HANA Database Module in which you want to create the calculation view.
Tip
If you do not already have a database module, right-click the root folder of your new MTA project and, in the context
menu, choose New SAP HANA Database Module .
4. Browse to the src folder, right-click it and choose New Calculation View .
Note
You can create a star join with data category as CUBE or SQL Access Only only.
6. Choose Create.
The tool opens a new graphical calculation view editor with a semantics node and a star join node.
c. In the Find Data Sources dialog box, enter the name of the calculation view with descriptive data.
Note
When adding calculation views as a data source in a star join node, you can use only calculation views with these
data category types: dimension or blank.
d. Choose Finish.
Continue modeling the graphical calculation view with a cube structure, which includes attributes and measures. The input
to the star join node must provide the central fact table.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b4… 9/74
1/10/2020
d. Create a join by selecting the required column from the left table, and dragging the cursor to the required column in
the right table.
e. (Optional) If you want to swap the left tables and right tables, then in the Join Creation dialog box, choose
(Swap Table).
10. Choose Save in the menu bar to save your calculation view.
The build process uses the design-time database artifacts to generate the corresponding actual objects in the database
catalog.
Prerequisites
You have the time-related tables with time data or have synonyms to the time-related tables ( M_TIME_DIMENSION_YEAR,
M_TIME_DIMENSION_MONTH, M_TIME_DIMENSION_WEEK, M_TIME_DIMENSION, M_FISCAL_CALENDAR) in the
same SAP HANA Database Module in which you are creating the calculation view.
Note
You can also generate time data in the standard time-related tables that are available in the _SYS_BI schema and use them as
data sources in the calculation view.
Procedure
1. Start SAP Web IDE in a Web browser.
2. If you want to create a new project for the calculation view, do the following:
a. In the SAP Web IDE, choose File New Project from Template .
Currently, there is only one type of project template available, namely: Multi-Target Application Project. Select
Multi-Target Application Project and choose Next.
c. Type a name for the new MTA project (for example, myApp and choose Next to con rm).
d. Specify details of the new MTA project and choose Next to con rm.
3. Select the SAP HANA Database Module in which you want to create the graphical calculation view.
Tip
If you do not already have a database module, right-click the root folder of your new MTA project and, in the context
menu, choose New SAP HANA Database Module .
4. Browse to the src folder, right-click it and choose New Calculation View .
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 10/74
1/10/2020
b. In the Data Category dropdown list, select Dimension.
d. Select the Auto Create checkbox if you want the tool to automatically include the time-related tables as data
sources in the calculation view, and also to de ne lters and hierarchies in the view based on the selected calendar
type and the granularity.
f. If you have selected the Gregorian calendar type, in Granularity dropdown list, select the required granularity.
g. Based on the Calendar type and the Granularity type (for Gregorian), in the Table eld, use the Find Data Sources
dialog box to search and select the time-related tables or the synonyms to the time-related tables.
6. Choose Create.
The tool opens a new calculation view editor. If you have not selected Auto Create, manually include the required time-
related tables as data sources and de ne lters, hierarchies based on your requirement.
Note
For the Fiscal calendar type, Auto Create only includes the M_FISCAL_CALENDAR table as data source in the
calculation view. It does not automatically de ne any lters or hierarchies in the view.
The build process uses the design-time database artifacts to generate the corresponding actual objects in the database
catalog.
Related Information
Create Time-Related Tables and Generate Time Data
Generate Time Data in the _SYS_BI Schema
Supported Calendar Types For Generating Time Data
Supported Time Range for Generating Time Data
Context
You can add a time-dimension to a calculation view by using the time-related tables from an SAP HANA Database Module as data
sources in the view. To generate time data, the tool supports Gregorian and Fiscal calendar types.
Procedure
1. Start SAP Web IDE in a Web browser.
2. In the Workspace view, right-click the SAP HANA Database Module and choose Modeling Actions Maintain Time Tables .
3. In the Generate Time Data dialog box, select the required calendar type.
a. Select all the required granularity levels for which you want to create the time-related tables.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 11/74
1/10/2020
Note
For the granularity level Week, specify the rst day of the week.
b. If you want to generate time data into the tables after creating them, select Generate Data After Creation and
specify the From year and To year for which you want to generate time data.
c. Choose Generate.
The tool automatically creates the time-related tables for the selected granularity. Browse to the time_tables folder
under the src folder in the SAP HANA Database Module to access the time-related tables.
b. If you want to generate time data into the tables after creating them, select Generate Data After Creation and
specify the From year and To year for which you want to generate time data.
c. In the Variant eld, use the value help to search and select the table that contains variant data.
Note
SAP tables T009 and T009B are typically used to store any variant data.
The variant speci es the number of periods along with the start and end dates.
e. Choose Generate.
The tool automatically creates the time-related tables for the selected granularity. Browse to the time_tables folder
under the src folder in the SAP HANA Database Module to access the time-related tables.
Related Information
Generate Time Data in the _SYS_BI Schema
Supported Calendar Types For Generating Time Data
Supported Time Range for Generating Time Data
Prerequisites
You have INSERT privileges on the time-related tables. You can use the SAP HANA database explorer to add a SYSTEM database
user.
Context
Use the SAP HANA database explorer to generate time-related data in the standard time-related tables. You can specify the
calendar type and the granularity to generate time data. The tool supports Gregorian and Fiscal calendar types..
Procedure
1. Start the SAP Web IDE in a Web browser.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 12/74
1/10/2020
3. Select the required HDI service for which the user has INSERT privileges on the time-related tables.
5. In the Calendar Type dropdown list, select the required calendar type.
6. In the From Year and To Year text elds, enter the start year and end year for which you want to generate time data into the
standard time-related tables.
7. If you have selected Gregorian as the calendar type, in the Granularity dropdown list, select the required granularity.
Note
For the granularity level Week, specify the rst day of the week.
a. In the Schema text eld, enter the name of the variant schema that contains tables having variant data.
Note
SAP tables T009 and T009B are typically used to store the variant data.
The variant speci es the number of periods along with the start and end dates.
9. Choose OK.
Note
For the Gregorian calendar type, the tool generates the time data in the M_TIME_DIMENSION_YEAR,
M_TIME_DIMENSION_MONTH, M_TIME_DIMENSION_WEEK, M_TIME_DIMENSION tables. For the Fiscal
calendar type, the tool generates the time data in the M_FISCAL_CALENDAR table. These tables are available in the
_SYS_BI schema.
Related Information
Create Graphical Calculation Views with Time Dimension
Supported Calendar Types For Generating Time Data
Supported Time Range for Generating Time Data
Gregorian Use the Gregorian calendar type, if your nancial year is same as the calendar year, for
example, January to December.
Fiscal Use the Fiscal calendar type, if your nancial year is not same as the calendar year, for
example, March to April.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 13/74
1/10/2020
For the Gregorian calendar type, based on the granularity you choose, the tool provides restrictions on the time range for which
you can generate time data.
For each granularity level, the following table displays the time range that the tool supports for generating time data.
Granularity Range
Note
The following restrictions are applicable for generating time dimension data:
The lling of these tables can be triggered by the following SQL commands:
MDX UPDATE TIME DIMENSION DAY 2010 2020; --> generates data in "_SYS_BI"."M_TIME_DIMENSION"
MDX UPDATE TIME DIMENSION WEEK 2010 2020; --> generates data in "_SYS_BI"."M_TIME_DIMENSION_WEEK"
MDX UPDATE TIME DIMENSION MONTH 2010 2020; --> generates data in "_SYS_BI"."M_TIME_DIMENSION_MONTH"
MDX UPDATE TIME DIMENSION YEAR 2010 2020; --> generates data in "_SYS_BI"."M_TIME_DIMENSION_YEAR"
MDX UPDATE FISCAL CALENDAR [<schema for T009 tables>] <variant> <startYear> <endYear> [<mandt>] [WITHL
If TARGET_SCHEMA is not speci ed, then _SYS_BI is used. Similarly, if TARGET_TABLE is not speci ed, then
M_FISCAL_CALENDAR is used.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 14/74
1/10/2020
If TARGET_SCHEMA is not speci ed, then _SYS_BI is used. Similarly, if TARGET_TABLE is not speci ed, then depending on the
granularity, the following tables are used:
M_TIME_DIMENSION_MONTH
M_TIME_DIMENSION_WEEK
M_TIME_DIMENSION_YEAR
M_TIME_DIMENSION
Prerequisites
You must already have created a remote source.
Context
The SAP Web IDE supports creating virtual tables with a code editor or a wizard. Creating virtual tables with the wizard helps, for
example, to create virtual tables when you are not aware of the syntax to create them with the code editor. After creating the
virtual tables, you can use them as data source.
Procedure
1. Start SAP Web IDE in a Web browser.
2. If you want to create a new project for the virtual table, do the following:
c. Type a name for the new project (for example, myApp) and choose Next to con rm.
d. Specify details of the new project and choose Next to con rm.
3. Select the SAP HANA Database Module in which you want to create the virtual table.
Tip
To create a database module, right-click the root folder of your new project and, in the context menu, choose New SAP
HANA Database Module .
4. Browse to the src folder, right-click it and choose New Virtual Table .
5. In the Create Virtual Object wizard, select a remote source and click Next.
6. Use the lter parameters to search for one or more remote objects you want to create a virtual table from and click Next.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 15/74
1/10/2020
8. Choose Save in the menu bar to save your calculation view.
The build process uses the design-time database artifacts to generate the corresponding actual objects in the database
catalog.
Use the join view node to query data from For retrieving customer details and location based on the
two data sources, based on a speci ed Postal_Code column in the CUSTOMER and GEOGRAPHY
condition. tables. The CUSTOMER table has columns Customer_ID,
Join
Customer_Name, and Postal_Code. The GEOGRAPHY table
Join view nodes can have two or more has columns Customer_ID, Postal_Code, Region, and
inputs. Country.
Use the graph view node to execute any Execute graph actions such as the shortest path or the
of the available graph operations or strongest connection between components in the graph
Graph actions on the graph workspace. workspace. The graph workspace includes the de nition of the
vertex table and edge table that are required to execute the
You can use this view node as the leaf
action.
node in the calculation view only.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 16/74
1/10/2020
Note
You can add data sources, unions, joins, projections, or aggregations as inputs to view nodes.
Related Information
Working With View Nodes
This section describes the different view nodes that you can use within graphical calculation views, along with examples of how
you can use them to model calculation views.
Related Information
Create Joins
Create Temporal Joins
Create Unions
Create Rank Nodes
Create Graph Nodes
Filter Output of View Nodes
Use Intersect Set Operation
Use Minus Set Operation
Use Hierarchy Functions
Anonymize Data Using Calculation Views
Model Table Functions as View Nodes
Create Joins
Use join view nodes in calculation views to query data from two or more data sources.
Context
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 17/74
1/10/2020
The join view nodes help combine columns from two data sources using records that are common to both the data sources. By
default, a join is an equi join because the condition to create such joins are based on the equality of two values.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag a join view node to the editor.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
In the editor canvas, you can view only limited number of columns. However, in the Mapping tab, you can view all columns
from the data sources.
4. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the join view node.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add
To Output.
c. Create a join by selecting the required column from the left table, and dragging the cursor to the required column in
the right table.
d. (Optional) If you want to swap the left tables and right tables, then in the Join Creation dialog box, choose
(Swap Table).
If you have more than two data sources in the join view node, you can create multiple join de nitions within a single
join view node (multi join). For each join de nition, in the Left Table dropdown list and in the Right Table dropdown
list, you can select the required left table and right table for the join de nition.
6. De ne join properties.
a. In the Join Creation dialog box, expand the General Properties section.
The tool analyses the data of tables participating in the join and proposes an optimal cardinality that you can use while
de ning the join properties.
a. In the General Properties section, choose (Propose Cardinality) next to the Cardinality dropdown list.
The tool can propose an optimal cardinality. Choose Yes to use the proposed cardinality.
Note
Choosing a valid cardinality for your data sources is necessary to avoid incorrect results from the engine, and to
attain better performance. Provide any cardinality value only if you are aware of the optimal cardinality for your
join.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 18/74
1/10/2020
8. Choose OK.
The tool supports creating joins between several data sources within a single join view node. If you are creating multiple
join de nitions (multi join), specify the central table and the order in which the tool must execute the join condition.
a. In the view editor, select a data source in the join view node and expand the Properties pane.
b. In the Multi Join Order dropdown list, select the required order.
By default, the join order is Outside In. It implies that the join condition is executed from the outside to the inside
with the central table as the reference (ending with the central table). If you set the join order as Inside Out, the tool
executes the join condition from the inside to the outside (starting from the central table).
c. In the Central Table dropdown list, select the required data source that you want to use a central table in the join
execution.
b. Choose + (Add).
b. Choose (Add).
Apply lters on output columns of the join view node to lter the output results.
c. In the expression editor, enter the expression that de nes the required lter conditions.
Use the elements, functions, and operators in the Filter Expression tab to build your expression.
For example,
(revenue >= 100 AND region = India) OR (revenue >=50 AND region = Germany)
b. Choose .
c. Drag the cursor to the view node for which you want to provide the input.
Related Information
Create Temporal Joins
Create Spatial Joins
Text Joins
Dynamic Joins
Optimize Join Execution
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 19/74
1/10/2020
Join Properties
Supported Join Types
Create Calculated Columns
Create Input Parameters
Context
A non equi join uses comparison operators like !=, >, <, >= and <= to query data from two data sources. Like a normal join, it
allows you to specify the cardinality and a join type (Inner, Left Outer, Right Outer) to query data from two data sources. If multiple
pairs of left and right columns are participating in join de nition, each pair can have different operator.
Restriction
You can add only two data sources in non equi jon view nodes and cannot create non equi joins between fact table and shared
dimensions.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag a non equi join view node to the editor.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
You can create constant values in any of the data source and use them in the join de nition. Creating constant helps, for
example, when you want to de ne a join condition by comparing a column value with a constant value.
b. Select the data source in which you want to create the constant value.
e. Choose OK.
5. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the non equi join view node.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add
To Output.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 20/74
1/10/2020
6. Create a join.
c. Create a join by selecting the required column from the left table, and dragging the cursor to the required column in
the right table.
d. (Optional) If you want to swap the left tables and right tables, then in the Join Creation dialog box, choose
(Swap Table).
a. In the Join Creation dialog box, expand the Non Equi Join Properties section.
Restriction
For non equi joins, you cannot create temporal joins, text joins, referential joins, dynamic joins.
If multiple pairs of left and right columns are participating in join de nition, each pair can have different operator.
Caution
In non equi join view nodes, using the EQ operator in the join condition may impact the performance of the join
execution. To de ne join conditions with EQ operator, we recommend you to use the normal join view node (equi
join).
The tool analyses the data of tables participating in the join and proposes an optimal cardinality that you can use while
de ning the join properties.
a. In the Non Equi Join Properties section, choose (Propose Cardinality) next to the Cardinality dropdown list.
The tool can propose an optimal cardinality. Choose Yes to use the proposed cardinality.
Note
Choosing a valid cardinality for your data sources is necessary to avoid incorrect results from the engine, and to
attain better performance. Provide any cardinality value only if you are aware of the optimal cardinality for your
join.
9. Choose OK.
b. Choose + (Add).
b. Choose (Add).
a. In the view editor, select the non equi join view node.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 21/74
1/10/2020
b. Choose .
c. Drag the cursor to the view node for which you want to provide the input.
Note
You cannot create calculated columns or any lter expressions in non equi join view nodes.
Context
In the join conditons for temporal columns, apart from the join columns, you can specify the temporal column from fact table and
temporal interval from dimension table.
Procedure
1. Open the calculation view in the view editor.
You can create temporal joins in the star join node only. The star join node must contain a calculation view with a
Dimension data category type as the data source, and the input to the star join node must provide the central fact table.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
4. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the join view node.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add
To Output.
5. Create a join.
Create a join by dragging a column from the shared calculation view (master table) to a column in the other data source
(fact table).
c. Create a join by selecting the required column from the left table, and dragging the cursor to the required column in
the right table.
d. (Optional) If you want to swap the left tables and right tables, then in the Join Creation dialog box, choose
(Swap Table).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 22/74
1/10/2020
6. De ne the temporal column and the temporal conditions.
In the Temporal Properties section, provide values to create the temporal join.
a. In the Temporal Column dropdown list, select a time column in the calculation view.
c. In the From Column and To Column dropdown lists, specify the start and end time values from the calculation view
to fetch the records.
7. Choose OK.
Related Information
Temporal Joins
Temporal Conditions
Example: Temporal Joins
Temporal Joins
A temporal join lets you set time intervals for which you want to fetch records. It indicates the time interval mapping between the
master data and the transaction data.
Temporal joins are based on the date and time eld from the fact table, and the time interval (to and from elds) from the master
data view. The date eld from the fact table is called temporal column.
If the temporal column values in the fact table are within the valid time interval values from the master data view that means the
tables are joined. A time interval is assigned to each record in the results set. These records are valid for the duration of the
interval to which they are assigned.
The supported data types for Temporal Column, From Column, and To Column are timestamp, date, time, and integers only.
Temporal Conditions
Temporal condition values, which you de ne in temporal joins, help determine whether to include or exclude the boundary values.
The boundary values of the time interval is de ned by the FROM and TO date elds of the master data view, while executing the
join condition. The following table lists the temporal conditions.
Include To Exclude From This temporal condition includes the value of the To Column eld and excludes the value of the
From Column eld while executing the join.
Exclude To Include From This temporal condition excludes the value of the To Column eld and includes the value of the
From Column eld while executing the join.
Exclude Both This temporal condition excludes the value from both the To Column eld and the From Column
eld while executing the join.
Include Both This temporal condition includes the value from both the To Column eld and From Column eld
while executing the join.
Consider a dimension calculation view named PRODUCT (master data) with attributes PRODUCT_ID, VALID_FROM_DATE, and
VALID_TO_DATE and a calculation view of type cube, SALES (transactional data) with attributes PRODUCT_ID, DATE, and
REVENUE.
Now, you can create a temporal join between the master data view and transaction data using the attribute PRODUCT_ID to
analyze sales of the product for a particular period.
Context
You use the join view node in a calculation view to create spatial joins, and create them by joining two database tables on columns
of spatial data types.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag a join view node to the editor.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
4. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the join view node.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add
To Output.
5. Create a join.
Create a join by dragging a column from the shared calculation view (master table) to a column in the other data source
(fact table).
c. Create a join by selecting the required column from the left table, and dragging the cursor to the required column in
the right table.
d. (Optional) If you want to swap the left tables and right tables, then in the Join Creation dialog box, choose
(Swap Table).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 24/74
1/10/2020
6. De ne spatial join properties.
Spatial predicates are conditions that return Boolean results. They serve as join conditions for spatial joins.
Note
If you select Relate as the predicate value, in the Intersection Matrix text eld enter the required values.
Similarly, if you select Within Distance as the predicate value, in the Distance eld, select a value. You can
provide the distance as a xed value or use an input parameter to provide the distance value at runtime.
b. If you want to execute the spatial join only if the predicate condition evaluates to true, in the Execute Join If
dropdown list, select Predicate Evaluates to True.
7. Choose OK.
Related Information
Supported Spatial Predicates
Supported Spatial Data Types
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 25/74
1/10/2020
Geometries The term geometry means the overarching type for objects such as points, linestrings, and polygons.
The geometry type is the supertype for all supported spatial data types.
Points A point de nes a single location in space. A point geometry does not have length or area. A point
always has an X and Y coordinate.
ST_Dimension returns 0 for non-empty points.
In GIS data, points are typically used to represent locations such as addresses, or geographic features
such as a mountain.
Linestrings A linestring is geometry with a length, but without any area. ST_Dimension returns 1 for non-empty
linestrings. Linestrings can be characterized by whether they are simple or not simple, closed or not
closed. Simple means a linestring that does not cross itself. Closed means a linestring that starts and
ends at the same point. For example, a ring is an example of simple, closed linestring.
In GIS data, linestrings are typically used to represent rivers, roads, or delivery routes.
In GIS data, multilinestrings are frequently used to represent geographic features like rivers or a
highway network.
Polygons A polygon de nes a region of space. A polygon constructed from one exterior bounding ring de nes
the outside of the region and zero or more interior rings, which de ne holes in the region. A polygon
has an associated area but no length.
In GIS data, polygons are typically used to represent territories (countries, towns, states, and more),
lakes, and large geographic features such as parks.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 26/74
1/10/2020
In GIS data, multipolygons are frequently used to represent territories made up of multiple regions (for
example a state with islands), or geographic features such as a system of lakes.
Text Joins
A text join helps obtain language-speci c data. It retrieves columns from a text table based on the session language of the user.
The text tables contain description for a column value in different languages. For example, consider a PRODUCT table that
contains PRODCUT_ID and a text table PRODUCT_TEXT that contains the columns PRODUCT_ID, DESCRIPTION, and
LANGUAGE.
PRODUCT
PRODUCT_ID SALES
1 1000
2 2000
3 4000
PRODUCT_TEXT
1 E Description in English.
1 D Description in German.
2 E Description in English.
3 E Description in English.
Create a text join to join the two tables and retrieve language-speci c data using the language column LANGUAGE. For example, if
your session language is E and if you have added all columns to the output of the join view node, the output of the text join is:
Note
For text joins, always add the text table as the right table.
When you execute a query, the engine evaluates the language setting of your connection. The texts are selected based on the
language setting.
You can set the language when you add a container in the SAP HANA database explorer. If you want to see the English language
being selected, then when adding a container, in the Advanced Options, specify LOCALE=en.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 27/74
1/10/2020
You can further specify the language like en_US. For more information, see 2364550 .
Dynamic Joins
After creating a join between two data sources, you can de ne the join property as dynamic. Dynamic joins helps improve the join
execution process by reducing the number of records processed by the join view node at runtime.
Dynamic joins are special type of joins. In this join type, two or more elds from two data sources are joined using a join condition
that changes dynamically based on the elds requested by the client. For example –Table1 and Table2 are joined on Field1 and
Field2. But, if only one, Field1 or Field2 is requested by a client, the tables (Table1 and Table2) are joined based only on the
requested eld (Field1 or Field2).
Note
You can set the Dynamic Join property only if the two data sources are joined on multiple columns.
Dynamic join behavior is different from the classical join behavior. In the classical join, the join condition is static. This means that,
the join condition does not change irrespective of the client query. The difference in behavior can result in different query result
sets. Use dynamic joins with caution.
Prerequisite
At least one of the elds involved in the join condition is part of the client query. If you de ne a join as dynamic, the engine
dynamically de nes the join elds based on the elds requested by the client query. But, if the eld is not part of the client query, it
results in query runtime error.
In a dynamic join, if the client query to the join doesn't request a join column, a query runtime error occurs. This behavior of
dynamic join is different from the static joins.
Dynamic join enforces aggregation before executing the join, but for static joins the aggregation happens after the join.
This means that, for dynamic joins, if a join column is not requested by the client query, its value is rst aggregated, and
later the join condition is executed based on columns requested in the client query.
Related Information
Example: Dynamic Joins
SALES
APJ IND 10
APJ IND 10
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 28/74
1/10/2020
APJ CHN 20
APJ CHN 50
EUR DE 50
EUR DE 100
EUR UK 20
EUR UK 30
PRODUCT
EUR DE PROD1
EUR DE PROD2
EUR UK PROD1
EUR UK PROD2
So you use a calculation view to join the above two data sources via two different aggregation view nodes as inputs to the join view
node. The aggregation view node with the data source SALES does not has the PRODUCT column but contains total sales for a
given region or country.
Now assume that the two aggregation view nodes join dynamically on the columns, REGION and COUNTRY. The outputs of the join
view node are columns REGION, PRODUCT, SALES and the calculated columns, TOT_SALES, and SALES_SHARE.
When you execute a client query on the calculation view to calculate the sales share of a product at a region level, the output from
the dynamic join and static join is different:
Dynamic Join
Static Join
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 29/74
1/10/2020
The dynamic join calculates the sales share at the region level by aggregating the sales values before joining the data sources. The
static join, on the other hand, rst calculates the sales share at the region level and the country level (because the join condition
contains both region and country), and then aggregates the resulting sales share after the join is executed.
You can avoid this default behavior by using the join property Optimizing Join Columns. When this property for a join is set to
True, only the columns speci ed in the query are retrieved from the database.
Note
Optimizing join columns is supported only for left outer joins with cardinality 1:1 or N:1, text joins with cardinality 1:1 or N:1, right
outer joins with cardinality 1:1 or 1:N, and referential joins.
If the lters are de ned on join columns for which you have enabled Optimize Join Columns, the join optimizer cannot remove
attributes of static lters. In this case, you can optimize the join column by introducing a dummy projection view node between the
join and the input node with static lters.
Note
Optimize join columns are not supported for non equi joins.
Prerequisites
The join eld is not requested in the query
Only elds from one join partner are requested in the query.
The cardinality to the join partner from which no elds are requested is set to 1.
In general, for scenarios that have multiple join partners on different join elds, if the query requests elds from only a small
subset of join partners, you can use the optimize join columns property to omit various join elds from the aggregation. This ag
helps to explicitly state to the join optimizer to not include the join elds in the aggregation. Omitting the join elds help reduce the
number of records processed by the join optimizer.
This optimization therefore results in a better performance and lower memory consumption. The extent of optimization depends
on the elds that the query request at runtime, and on which elds you have de ned the join.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 30/74
1/10/2020
Remember
Using a wrong cardinality impacts the result set.
Join Properties
After creating a join, de ne its properties to obtain a desired output when you execute the join.
Join
Properties Description
Join Type The value of this property speci es the join type used for creating a join. For more information, see Supported Join Types.
Cardinality The value of this property speci es the cardinality used for creating a join.
By default, the cardinality of the join is empty. If you are uncertain about the right cardinality for the join tables, we
recommend you to not specify any cardinality. The system determines the cardinality when executing the join.
Language The value of this property speci es the language column that the tool must use for executing text joins. For more
Column information, see Text Joins.
Dynamic The value of this property determines whether the tool must dynamically de ne the columns of the join condition based on
Join the client query. For more information, see Dynamic Joins.
Optimize The value of this property determines whether the tool must retrieve the columns that are not speci ed in the query from the
Join database. For more information, see Optimize Join Execution.
Columns
Inner Returns all rows when there is at least one match in both the data sources.
Left Outer Returns all rows from the left data source, and the matched rows from the right data source.
Right Outer Returns all rows from the right data source, and the matched rows from the left data source.
Text Join This join type is used to obtain language-speci c data from the text tables using a language column.
Full Outer Displays results from both left and right outer joins and returns all (matched or unmatched) rows
from the tables on both sides of the join clause.
Referential This join type is similar to inner join type, but assumes that referential integrity is maintained for the
join tables.
You can optimize the performance of referential joins by additionally specifying the join direction. The join direction provides more
information to the optimizer on the direction of referential integrity, which helps prune tables participating in the join condition.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 31/74
1/10/2020
The join type is Referential.
The query on the calculation view does not request any elds from the to-be-pruned table.
The join cardinality is set to “..1” or "1.." based on the join direction for the to-be-pruned table.
The tool supports the following as the join directions for referential joins.
Direction Description
Left It is the default join direction and implies that the referential integrity is provided by the left
table.
Both The optimizer evaluates both the tables in the join condition.
Create Unions
Use union view nodes in calculation views to combine the results of two or more data sources.
Context
A union view node combines multiple data sources. These data sources can have multiple columns. You can manage the output
column of a union view node by:
Create a target output column with constant values and map the source columns with the constant values.
For source columns, which do not have mappings to any of the output columns, create a target output column and map it to the
unmapped source columns.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag and drop a union view node to the editor.
b. Choose
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list. (Add Data
Source).
d. Choose Finish.
4. De ne output columns.
b. On the Mapping (Add pane, select the columns you want to add to the output of the union view node.
Note
If you want to add all columns from the data source to the output, in the context menu of the data source,
choose Add To Output.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 32/74
1/10/2020
c. In the Create Target and Manage Mapping dialog box, provide a name for the new constant output column.
e. In the Source Column dropdown list, select the required column from the data source with which you want to map
the constant output column.
f. In the Constant Value text eld, provide the required constant value.
g. Select is Null checkbox, if you want to assign a null value to the constant output column.
Note
If you do not provide any constant value, then the tool, by default, considers the constant output column value
as null.
h. Choose OK.
b. Choose + (Add).
b. Choose (Add).
b. Choose .
c. Drag the cursor to the view node for which you want to provide the input.
Related Information
Example: Constant Columns
Empty Union Behavior
Prune Data in Union Nodes
Create Calculated Columns
Assign Variables
Create Input Parameters
The data type of the input column is determined by the data type of the column in the source. Therefore, it typically corresponds
to the data type of the column in a source table. The data type of the output column is determined by the below rules.
As a general rule, avoid implicit castings of input columns. Instead, map input columns of the same data type with the same
output column. Nevertheless, if columns of some speci c data types are mapped, implicit casting happens. Below is a list of the
data types for which implicit casting happens.
In the following, we refer to data types NVARCHAR, VARCHAR and SHORTTEXT with the term “string_type” and to data types
TINY, SMALL, INTEGER with the term “integer_type”.
In the list below “ x <-> y “ means that implicit casting happen between data type x and data type y.
Note
Do not rely on implicit casting between other data types. In future releases we will open up implicit castings between additional
data types and list this in the documentation and SAP Note 2823865.
Currently, NCLOB, BLOB, LOB are only implicitly casted if they are not used as the rst data source of the UNION node ( “x -> y”
means that implicit casting only happens from data type x to data type y but not the other way around):
For example, UNION of string_type and NCLOB would work while the reverse order, UNION of NCLOB and string_type, would fail.
Context
You can manually create pruning con guration tables (. hdbcds tables) or use the form-based table editor that the tool provides
to create them. After creating a pruning con guration table, reference it in the target calculation view properties.
Remember
If the queries executed on the union view node unfolds and does not perform any aggregation, then the tool does not prune
data. In such cases, switch off the unfolding behavior with the hint, NO_CALC_VIEW_UNFOLDING.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 34/74
1/10/2020
Unfolding is the normal query execution behavior in which the query execution is passed to the SQL engine or the optimizer after
the calculation engine instantiates the query. This unfolding behavior is not possible for complex calculation views.
Procedure
1. Open the required calculation view in which you want to de ne the data pruning for its union view nodes.
d. Choose Advanced.
3. If you have already created a pruning con guration table and if you want to use the same for the selected calculation view,
then in the Pruning Con guration Table eld, use the search to nd and add the required table.
Note
You can use only tables or views as pruning con guration tables.
a. In the Table Name text eld, enter a name for the pruning con guration table.
b. Choose + to add a lter condition that limits the result set of a union view node.
You can add more than one lter condition in a single pruning con guration table. If you are creating multiple lter
conditions using the same column, then the lter conditions are combined using the logical OR operator. But, if you
are using different columns to provide the lter conditions, then the lter conditions are combined using the logical
AND operator.
c. In the Input eld, use the value help to select a data source in the union view node.
d. In the Column eld, use the value help to select a column from the data source.
e. In the Operators dropdown list, select the required operator to de ne the lter condition.
f. Use the Low and High text elds based on the selected operator to de ne the lter condition.
The tool creates the pruning con guration table and all other les (.hdbcds, .hdbtabledata, and .csv) that are necessary to
prune the data. These les are created in the same SAP HANA Database Module in which you have created the calculation
view.
6. (Optional) Choose (Edit Pruning Con guration) to edit an existing pruning con guration table used for the selected
calculation view.
Related Information
Union Node Pruning
Pruning Con guration Table
Example with a Pruning Con guration Table
Example with a Constant Mapping
Example Tables
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 35/74
1/10/2020
To prune data sources, you need either a pruning con guration table or a constant mapping. If you opt for the con guration table
approach, you use a table to specify data slices contained in the individual data sources. This information is matched to the query
lter when the query is run, and as a result, only the required data sources are processed. With constant mapping, you de ne a
constant with speci c values for each data source and select the appropriate value in your query.
For example, you are creating a sales report for a product across the years using a calculation view. The calculation view consists
of two data sources, one with the current sales data (for YEAR >= 2018) and the other with the archived sales data (YEAR <=
2017). Both are provided as input to a union node in the calculation view, as shown below:
In your scenario, you want to query the calculation view to get the results of CURRENT_SALES only. You therefore want the query
to be executed on the CURRENT_SALES data source only, and the operation on the archived data source to be excluded (that is,
pruned). To do so, you have the following options:
You create a constant that maps the data sources to speci c constant values.
Note
In general, constant mapping improves performance more but is less exible than using a pruning con guration table.
Note
If a union node is consumed by a rank node, query lters will, by default, not be pushed down to it when the query is executed.
This applies to lter expressions and variables used in a WHERE clause. However, to be able to apply pruning, the union node
needs the lters. In these cases, therefore, the combination of rank node and union node with pruning only makes sense if the
Allow Filter Push Down option has been activated for the rank node.
Related Information
Pruning Con guration Table
Example with a Pruning Con guration Table
Example with a Constant Mapping
Example Tables
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 36/74
1/10/2020
SAP Note 2752070
CALC_SCENARIO Fully quali ed name of the calculation view to which union node pruning is to be
applied. For example, p1.p2::CV_PRUNING, where p1.p2 is the namespace and
CV_PRUNING is the name of the calculation view.
INPUT Name of the data source in the union node of the calculation view.
To assign a pruning con guration table to a calculation view, select the Semantics node and choose View Properties Advanced .
Note that if you have not already created a pruning con guration table, you can both create and build it from here.
Context
The calculation view is based on the example shown earlier. The Union node is used to combine the two data sources
Current_Sales and Old_Sales. In the procedure below, you query the calculation view to get the current sales results only.
Procedure
1. Create a pruning de nition in a pruning con guration table. For example:
Table: UNION_PRUNING
Note
You can also create the table within step 3.
2. In the calculation view, select the Semantics node and choose View Properties Advanced .
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 37/74
1/10/2020
3. In the Pruning Con guration Table eld, use the search to nd and add the pruning con guration table created above, or
choose + to create the table. For example:
The calculation view now contains the pruning con guration table with the two data sources CurrentSales and OldSales.
5. Execute a query on the calculation view with a lter condition that is the same as the condition de ned in the pruning
con guration table. For example:
SELECT
"SALESORDER",
"PRODUCT",
"YEAR",
SUM("SALES") AS "SALES"
FROM "JOINCARDINALITYEXAMPLE_HDI_DB_1"."p1.p2::CV_PRUNING"
WHERE "YEAR" >= '2018'
GROUP BY "SALESORDER", "PRODUCT", "YEAR";
This con rms that the union node could be pruned because the lter condition matches the one in the pruning
con guration table.
8. Remove the pruning con guration table from the view properties of the calculation view and build it again.
9. Enter the same query as above and choose Analyze SQL from the Run dropdown menu.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 38/74
1/10/2020
As can be seen, the query is now invoking both the archived sales data and current sales data, although only the current
sales data is required. For example:
The presence of the Old_Sales table indicates that the union node was not pruned.
Results
As demonstrated therefore, union node pruning in calculation views allows the execution ow to be determined dynamically based
on the query. This allows resource consumption to be reduced and performance improved.
Context
The calculation view is based on the example shown earlier. The Union node is used to combine the two data sources
Current_Sales and Old_Sales. In the procedure below, you use the debug feature to visualize the pruning.
Procedure
1. Create a calculation view with a Union node as follows:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 39/74
1/10/2020
a. On the Mapping tab of the Union node, choose + (Create Constant) in the Output Columns toolbar.
b. Enter the details required to differentiate between the two data sources. For example:
4. To start debugging, select the Semantics node and then choose the Debug button.
5. On the Debug Query tab, add the following WHERE clause to the default debug query:
For example:
SELECT "SALESORDER",
"PRODUCT",
"YEAR",
SUM("SALES") AS "SALES"
FROM "JOINCARDINALITYEXAMPLE_HDI_DB_1"."p1.p2::UNION_PRUNING"
WHERE "SALESYEAR" = 'CURRENT'
GROUP BY "SALESORDER", "PRODUCT", "YEAR", "SALESYEAR";
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 40/74
1/10/2020
6. Click Execute to run the query.
The Old_Sales data source is now grayed out, indicating that is not being processed. For example:
The reason why it has been excluded is that the SALESYEAR lter does not match the constant value OLD that you de ned
for it.
For example:
SELECT "SALESORDER",
"PRODUCT",
"YEAR",
SUM("SALES") AS "SALES"
FROM "JOINCARDINALITYEXAMPLE_HDI_DB_1"."p1.p2::UNION_PRUNING"
WHERE "SALESYEAR" = 'OLD'
GROUP BY "SALESORDER", "PRODUCT", "YEAR", "SALESYEAR";
This time the Current_Sales data source is grayed out. For example:
Results
As shown above, when a constant is added to the union node of a calculation view, queries that apply a lter on that constant will
prune the applicable data sources in the Union node. This technique can be used to improve the runtimes of complex models.
Example Tables
The following tables are used in the examples.
Current_Sales
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 41/74
1/10/2020
Current_Sales
Old_Sales
For example, consider that you want to compare the planned sales of each quantity with its actual sales using two data sources
with similar structures, ACTUALSALES and PLANNEDSALES.
ACTUALSALES
SALES_QUANTITY PRODUCT_ID
5000 P1
3000 P2
PLANNEDSALES
SALES_QUANTITY PRODUCT_ID
4000 P1
4000 P2
When you use a union view node to combine the results of the two data sources, you cannot differentiate the data from these data
sources.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 42/74
1/10/2020
SALES_QUANTITY PRODUCT_ID
5000 P1
3000 P2
4000 P1
4000 P2
In such cases, create a constant output column PLANNED_OR_ACTUAL and assign the constant value ACTUAL to
ACTUALSALES and the constant value PLANNED to PLANNEDSALES.
5000 P1 ACTUAL
3000 P2 ACTUAL
4000 P1 PLANNED
4000 P2 PLANNED
Now, you can identify the data source and its underlying data.
This property is useful, for example, for value help queries in applications. You can select either No Row or Row with Constant as
values for the Empty Union Behavior property. Select the data source in the mapping de nition and, in the Properties tab, de ne
the values for this property based on your business requirement.
For understanding the Empty Union Behavior property and how its value determines the output data, consider the following
mapping de nition in a union view node:
Constant values A and B are de ned for Projection_1 and Projection_2 using the constant column, CONSTANT.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 43/74
1/10/2020
When you execute a query on a calculation view with this union view node, and if the column CUSTOMER_ID is not queried, then
the Empty Union Behavior property of Projection_2 determines whether the constant column, CONSTANT returns the constant
value, A for Projection_2 in the output:
If the Empty Union Behavior property is set to No Row, then no data from Projection _2 appears in the output data. Only
data from Projection_1 appears in the output data.
If the Empty Union Behavior property is set to Row with Constant, the output data includes one record from Projection
_2. In this one record, the constant value A appears for the CONSTANT column and values for all other columns appears as
null.
Context
For example, consider a TRANSACTION table with two columns PRODUCT and SALES. If you want to retrieve the top ve
products based on sales, use a rank node. The rank node rst partitions the TRANSACTION table with the PRODUCT as the
partition column, and performs an order by operation on the partitioned table using the SALES column to retrieve the top ve
products based on sales.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag the rank node to the editor.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
4. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the rank node.
Note
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 44/74
1/10/2020
If you want to add all columns from the data source to the output, in the context menu of the data source,
choose Add To Output.
Function Description
Note
The aggregation functions listed here are available with SPS 04 version onwards. If you have created rank nodes
with the earlier version, you can still open the calculation view in the edior and work with the rank view nodes.
But, in such cases you can only use the UI capabilities supported in earlier versions for the rank view node.
For example on the behavior of these functions, see the Related Information section.
Value Description
TOP Retrieves top N records from the ordered set, where N is the
target value speci ed.
Type Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 45/74
1/10/2020
Type Description
The Target Value helps identify the number of records that the query must retreive to the output of the rank node. If
the target value is N, the query retrieves records from the ordered set with rank up to N. You can specify the target
value as a xed value or use an input parameter to provide the value at runtime.
The value helps offset or skip records with rank up to M from the ordered set to the output of the rank node, where
M is the offset value that you specify. You can provide the offset value as a xed value or use an input parameter to
provide values at runtime.
If you want to generate an additional output column in the rank node to store the rank values, select the Generate Rank
Column checkbox.
The rank node enables you to perform logical partition of the ordered set using one or more partition columns.
b. In the Column dropdown list, select a column that the tool must use to partition the data.
Select to partition the data with only partition by columns that the query requests for processing the rank node.
Note
In the converse, without dynamic partition, the tool partitions the data with all partition by columns in the Partition By
section, even if these columns are not requested in the query.
You can use one or more columns to ORDER BY and de ne the sort direction to order records in each partition.
a. In the Sort Column section, choose + to add one or mode columns as the ORDER BY columns.
b. Choose (Add).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 46/74
1/10/2020
b. Choose .
c. Drag the cursor to the view node for which you want to provide the input.
Related Information
Assign Variables
Create Input Parameters
Prerequisites
You have at least one vertex table, one edge table, and one graph workspace, in the same SAP HANA Database Module as the
calculation view.
Context
Graphs are a powerful abstraction that can be used to model different kinds of networks and linked data coming from many areas,
such as logistics and transportation, utility networks, knowledge representation, text processing, and more. SAP HANA Graph is
an integral part of SAP HANA core functionality. It expands the SAP HANA platform with native support for graph processing and
allows you to execute typical graph operations on the data stored in an SAP HANA system.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag a graph node to the editor.
Note
You can add graph nodes in calculation views as leaf nodes only.
c. In the Find Data Sources you have at least one vertex table, one edge table, and one graph workspace, in the same
HDB dialog box, enter the name of a graph workspace and select it from the list.
Note
You can add only a graph workspace as the data source in graph view nodes. An SAP HANA Database Module
can have multiple graph workspaces, vertex tables, or edge tables.
d. Choose Finish.
4. Select an action.
Select a supported action (a graph operation or algorithm) that you want to execute on the graph workspace.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 47/74
1/10/2020
c. Select the required action.
After selecting an action, de ne values for all parameters that are necessary to execute the action. You can also create and
use input parameters to provide values.
For pattern matching, you can use the graphical editor to visually compose the pattern. The pattern comprises of vertices
connected by edges. Use the + (Add Vertex) icon in the menu bar to add a vertex to the editor and drag the cursor from one
vertex to the other to create an edge. After composing your pattern, de ne conditions on the vertex. In the Mapping tab,
de ne the output columns.
For pattern matching with cypher editor, write the required pattern matching query using the supported subset of the
Cypher query language on the given graph workspace. After writing the query, choose Generate Column to create the
output columns.
The output columns of a graph node vary depending on the action you select.
a. Select the Columns tab to view output columns of the graph node.
a. Select the Parameters tab and create a new input parameter. You can create input parameters to parameterize the
execution of graph node and provide values at runtime to execute the graph node.
You can use this input parameter while de ning the parameters necessary to execute a selected action.
You can add the output of graph view nodes as inputs (to data source) to multiple view nodes at the same time. If you are
using Shortest Path action in your graph view node, you can optionally add the output edge table from the graph view node
as inputs to other view nodes. Select the graph node and choose (Edge Output) to add the edge table as an input to a
view node.
Related Information
SAP HANA Graph Model
Graph Workspaces
Supported Graph Actions in Calculation Views
The SAP HANA Graph model provides basic information for creating graphs to depict data relationships visually. It allows typical
graph operations to be run on the data stored in an SAP HANA system.
Graphs are powerful abstraction that can be used to model different kinds of networks and linked data coming from many areas,
such as logistics and transportation, utility networks, knowledge representation, text processing, and more.
In SAP HANA, a graph is as a set of vertices and edges. Each edge connects two vertices; one vertex is denoted as the source and
the other as the target. Edges are always directed and there can be two or more edges connecting the same two vertices. Vertices
and edges can have an arbitrary number of attributes. Both vertices and edge attributes consists of a name, which is associated
with a data type and a value. Edge attributes consist of the same information.
For more information about the SAP HANA Graph model, see SAP HANA Graph Reference Guide.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 48/74
1/10/2020
Graph Workspaces
A graph workspace is an object in the database that de nes a graph that consists of tables and columns.
Vertex table
Edge table
Note
You can use CDS tables or SQL syntax to create vertex tables and edge tables. For more information on how to create
vertex tables and edge tables, see the SAP HANA Graph Reference guide.
The following code shows a simple example of a graph workspace de nition for XS advanced HDI:
Code Syntax
/src/my_graph_workspace.hdbgraphworkspace
In the con guration le for the HDI container (.hdiconfig), the plug-in con guration should look like the following example:
Code Syntax
.hdiconfig
"hdbgraphworkspace" : {
"plugin_name" : "com.sap.hana.di.graphworkspace",
"plugin_version": " "
}
The following table lists the supported graph actions that you can execute using the graph view node in a calculation view.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 49/74
1/10/2020
Action Description
Neighborhood Retrieves the neighboring vertices within the given radius (depth) from the given start vertices.
Shortest Path (One-to-All) Provides the information for the shortest path from the starting vertex to all reachable
vertices.
Shorted Path (One-to-One) Returns the shortest path from the provided start vertex to the provided target vertex.
Strongly Connected Components Calculates strongly connected components (SCC) in the given graph workspace.
Pattern Matching Identi es all the subgraphs (within a graph) that match the given pattern.
Related Information
Neighborhood
Shortest Path (One-to-All)
Shortest Path (One-to-One)
Strongly Connected Components
Pattern Matching
Neighborhood
The Neighborhood graph action retrieves the neighboring vertices within the given radius (depth) from the start vertices.
This action lets you specify multiple start vertices, choose a traversal direction, set lters on vertices and edges, and set minimum
and maximum depth (radius) of the neighborhood.
Parameter Value
Direction Traversal direction, can use one of the following values: any, incoming, and outgoing (default:
outgoing).
Minimum Depth Minimum depth (radius) of the neighborhood. 0 means that the start vertices are included in the
result.
Vertex Filter Vertex lter expression analogous to SQL where-clause on the vertex table (default: empty).
Edge Filter Edge lter expression analogous to SQL where-clause on the edge table (default: empty).
Vertex Table Primary Key Contains the set of explored vertices with vertex table primary key.
Shortest Path action returns the shortest paths from the provided start vertex to all reachable vertices in the graph also known as
single-source shortest path (SSSP). The resulting shortest paths form a tree structure with the start vertex at the root. All other
vertices carry the shortest distance (smallest weight) information. The non-negative edge weights are read from the column
provided in the edge table.
Parameter Value
Weight Column A column in the edge table that contains edge weights. If omitted, edge weights are set to
1.
Direction Traversal direction, can use one of the following values: any, incoming, outgoing.
Vertex table Contains vertex keys and corresponding smallest weights (shortest distances)
The resulting table contains all vertices with the distance to the start vertex that are part of the shortest path between the start
vertex and target vertex.
Note
Theoretically, there is more than one shortest path between two vertices with the same distance. This algorithm returns one of
them.
The non-negative edge weights are read from the column provided in the edge table.
Parameter Value
Weight Column A column in the edge table that contains edge weights. If omitted, edge weights are set to
1.
Direction Traversal direction, can use one of the following values: any, incoming, outgoing.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 51/74
1/10/2020
Source Column Name in output table that contains the source of the traversed edge.
Ordering Name in output table that contains the target of the traversed edge.
Vertex Table Primary Contains the set of explored vertices with vertex table primary key.
Key
Strongly connected components partition the given graph workspace into largest subgraphs possible, where every vertex is
reachable from every other vertex. Knowing strongly connected components is helpful for cycle detection, because, by de nition,
the cycles can only exist within strongly connected components and they cannot cross strongly connected component
boundaries.
The only output of this action is a table containing the vertex key column and a COMPONENT column containing strongly
connected component indexes. All vertices having the same component index belong to the same strongly connected component.
Vertex Table Primary Key Contains the set of explored vertices with vertex table primary key.
Pattern Matching
Pattern matching is a kind of graph query, which involves nding all the subgraphs (within a graph) that match the given pattern.
The graphical calculation view editor in the SAP Web IDE provides two approaches to model calculation views with graph nodes
that help execute graph pattern queries. In the rst approach, you can use the graphical pattern matching editor to create and
execute graph pattern queries. In the second approach, describe the pattern in the openCypher query language (Cypher is a
registered trademark of Neo Technology, Inc.) within the graph node and execute them.
The graphical pattern contains a set of vertex variables, a set of edge variables, a set of lter conditions, a projection list, an order-
by list, a limit, and an offset.
The result of the graphical pattern matching query is a projection of subgraphs within a given graph workspace that matches the
given pattern. The columns of the result table correspond to the projection list of the given pattern. Every row in the result table
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 52/74
1/10/2020
corresponds to a matching subgraph.
In the editor, choose + to add a new vertex. After adding vertices to the editor, select a vertex and choose to create an
edge.
expression A query string written in the supported subset of the Cypher query
language containing one MATCH clause and one RETURN clause.
result table Every row corresponds to a matching subgraph. Every row contains
attributes of vertices and edges speci ed in the RETURN clause.
In the editor, choose Generate Column to de ne the output columns of the graph node. The tool includes the columns in the
RETURN clause as the output columns of the graph node.
Note
For more information on openCypher Query language, see the SAP HANA Graph Reference guide.
Context
Intersect set operations on data sources in calculation views help retrieve rows that are common to both the data sources. The
tool supports performing intersect set operations only for two data sources at a time. After performing the intersect set operation,
you can use the result of the intersect set operation as inputs to other view nodes.
For example, you can perform intersect set operations on SALES_2016 and SALES_2017 to identify the subset of products sold
during both, 2016 and 2017.
Note
You can perform intersect operation only if both the data sources have same number of elds with matching data types.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag and drop an intersect view node to the editor.
Note
You must have two data source in the intersect view node.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 53/74
1/10/2020
a. Select the intersect view node.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
4. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the intersect view node.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add
To Output.
c. In the Create Target and Manage Mapping dialog box, provide a name for the new constant output column.
e. In the Source Column dropdown list, select the required column from the data source with which you want to map
the constant output column.
f. In the Constant Value text eld, provide the required constant value.
g. Select is Null checkbox, if you want to assign a null value to the constant output column.
Note
If you do not provide any constant value, then the tool, by default, considers the constant output column value
as null.
h. Choose OK.
b. Choose + (Add).
b. Choose (Add).
b. Choose .
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 54/74
1/10/2020
c. Drag the cursor to the view the node for which you want to provide the input.
Related Information
Create Calculated Columns
Assign Variables
Create Input Parameters
Context
Minus set operations on data sources help rst retrieve all rows from the rst data source, and then removes all rows that appear
in the result set of the second data source. The tool supports performing minus set operations only for two data sources at a time.
After performing the minus set operation, you can use the result of the set operation as inputs to other view nodes.
For example, you can perform minus set operations on SALES_2017 and SALES_2016 to identify those products that were sold
in 2017, but not in the year 2016.
Note
The results of the minus set operations are dependent on the order of the data sources in the minus view node, and you can
perform minus operation only if both the data sources have same number of elds with matching data types.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag and drop a minus view node to the editor.
You must have two data source in the minus view node.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
If you want to switch the order of the data sources in the node, right-click the minus view node and choose Switch
Order.
4. De ne output columns.
b. On the Mapping tab, select the columns you want to add to the output of the minus view node.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add To
Output.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 55/74
1/10/2020
Create new output columns and assign it with constant values.
c. In the Create Target and Manage Mapping dialog box, provide a name for the new constant output column.
e. In the Source Column dropdown list, select the required column from the data source with which you want to map
the constant output column.
f. In the Constant Value text eld, provide the required constant value.
g. Select is Null checkbox, if you want to assign a null value to the constant output column.
Note
If you do not provide any constant value, then the tool, by default, considers the constant output column value
as null.
h. Choose OK.
b. Choose + (Add).
b. Choose (Add).
b. Choose .
c. Drag the cursor to the view the node for which you want to provide the input.
Related Information
Create Calculated Columns
Assign Variables
Create Input Parameters
Context
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 56/74
1/10/2020
The hierarchy function view nodes enable you to use the hierarchy generator functions to generate hierarchies and to use the
hierarchy navigation functions on the generated hierarchies to efficiently compute ancestors, descendants, or siblings of nodes.
The tool supports using the following functions in the hierarchy function view nodes.
Hierarchy Leveled Generates a hierarchy based on source data that has a leveled format.
Hierarchy Span Tree Generates a hierarchy for a recursive parent-child source containing only the rst shortest
path between each start and result node.
Hierarchy Temporal Generates a time-dependent hierarchy for recursive parent-child source data whose edges are
additionally quali ed by validity intervals.
Hierarchy Ancestors This function helps navigate all ancestors of a set of start nodes in a hierarchy.
Hierarchy Descendants This function helps navigate all descendants of a set of start nodes in a hierarchy.
Hierarchy Siblings This function helps navigate all siblings of a set of start nodes, including the start
nodes.
Related Information
Generate Hierarchies
Use built-in hierarchy generator functions that SAP provides to translate the diverse relational source data into hierarchies that
can be represented in a generic and normalized tabular format.
Context
The structure of a hierarchy generated from a hierarchy function is always the same, regardless of the original format of the
source data, and consists of an ordered list of its nodes. The nodes themselves are represented by a minimal set of orthogonal
hierarchy topology attributes plus a projection of the original source attributes.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag a hierarchy function view node to the editor.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
The hierarchy is generated from the data source that you select. You can add only one data source in the hierarchy
view node.
d. Choose Finish.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 57/74
1/10/2020
a. In the details pane, select the De nition tab.
b. Choose .
c. Select Generator.
d. Select the required hierarchy function that you want to use to generate the hierarchy.
5. (Optional) Concatenate multi-column tuple-like node identi ers into single scalar values.
You can combine two or more scalar expressions into a single value for use as a unique, reliable value by hierarchy
generator functions. The resulting values have additional characters encoding the lengths of the components to ensure
uniqueness within the results.
Parent In the value help list, select an attribute column in the data source that speci es the Hierarchy
PARENT_ID (parent). Function,
Hierarchy Span
Tree, Hierarchy
Temporal
Child In the value help list, select an attribute column in the data source that speci es the Hierarchy
NODE_ID (node). Function,
Hierarchy Span
Tree, Hierarchy
Temporal
Level In the De ne Levels pane, choose + to select one more attribute columns that speci es Hierarchy Leveled
the levels.
Start The start condition helps identify the root nodes. Use the expression editor to specify the Hierarchy
start condition as an expression. Function,
Hierarchy Span
Remember
Tree, Hierarchy
The start condition is applied as an additional lter on the data source. If a start
Temporal
condition is not speci ed, then root nodes are identi ed by the condition WHERE
PARENT_ID IS NULL.
Depth The depth can be a xed value or an input parameter. It speci es the maximum search Hierarchy
depth during hierarchy generation. Function,
Hierarchy Span
Tree, Hierarchy
Temporal
Valid From and In the value helps list, select the attribute columns that provides the required validity Hierarchy
Valid To intervals. You can provide a xed value from selected attribute columns or use an input Temporal
parameter to specify the validity intervals.
Orphan Handling In the dropdown list, select a value that speci es the orphan handling policies. Hierarchy
Function
Ignore: Orphans are silently ignored and is the default behavior.
Note
Error: If the input data contains any orphans, then an error is raised.
Adopt: Top-level orphans are adopted as children of the last root behind its
regular descendants.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 58/74
1/10/2020
Cache Orphans are always ignored for Hierarchy Span Tree, Hierarchy Temporal, and Hierarchy Hierarchy
Leveled generatorIn the dropdown list, select a value that speci es the caching policy for Function,
the generated hierarchy.Orphans are always ignored for Hierarchy Span Tree, Hierarchy Hierarchy Span
Temporal, and Hierarchy Leveled generator functions. Tree, Hierarchy
Temporal,
Cache: The generated hierarchy is cached if the system assesses the source to
Hierarchy Leveled
be reliably deterministic. Cache is the default behavior.
Force Cache: The generated hierarchy is cached even if the source cannot be
assessed to be reliably deterministic.
Siblings Order By In the Siblings Order By pane, choose + to use one or more output columns of the view Hierarchy
node to SIBLING ORDER BY and sort the output sibling nodes. In the Sort Direction Function,
dropdown list, select the required sort direction. Hierarchy Span
Tree, Hierarchy
Temporal,
Hierarchy Leveled
7. De ne output columns.
If required, you can add one or more columns from the data source as output columns to the view node.
b. On the Mappings tab, select the columns you want to add to the output of the hierarchy function view node.
Note
Some default attributes are calculated by the hierarchy generator function and are part of the output columns.
You cannot edit them.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose In
the value help list, select an attribute column in the data source that speci es the PARENT_ID (parent).In the
value help list, select an attribute column in the data source that speci es the PARENT_ID (parent).nullnullnull
nullAdd To Output.
b. Choose (Add).
After creating a hierarchy function view node to generate hierarchies, you can use hierarchy generator function results as
inputs to other view nodes. For example, you can use the generated hierarchy as inputs to other hierarchy functions view
nodes that are de ned with hierarchy navigation functions.
b. Choose .
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 59/74
1/10/2020
c. Drag the cursor to the view node for which you want to provide the input.
Related Information
Navigate Hierarchies
SAP HANA provides built-in navigation functions that use optimized algorithms on the hierarchy attributes to efficiently compute
ancestors, descendants, or siblings of nodes.
Context
Complex calculations on the hierarchy involving a start set of nodes and potentially multiple steps beyond their immediate
neighborhood are termed navigations.
Procedure
1. From the tool palette of the editor, drag a hierarchy function view node to the editor.
To add, use the result of a hierarchy generator function as input to this view node.
Remember
The hierarchy generator result must contain all the basic hierarchy attributes computed by a hierarchy generator
function.
b. (Optional) Add an additional input table or a data source with a lter condition that speci es the start nodes.
This means that, input to the hierarchy function view node must contain, at minimum, a column named or aliased
as START_RANK that has a data type that can be cast to BIGINT. If the start nodes are not speci ed, then the
navigation starts from all nodes in the hierarchy.
If you are specifying the start node as an additional input table or a lter condition on a data source, then also specify
which of the two inputs in the view node is a hierarchy generator function.
b. In the Data Sources pane, select a data source that is a hierarchy generator.
c. Choose .
Hierarchy Siblings Lists all siblings of a set of start nodes, including the start
nodes.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 60/74
1/10/2020
Remember
If the start nodes are not speci ed, then the navigation starts from all nodes in the hierarchy.
Distance From Specify a scalar integer value as minimum HIERARCHY_DISTANCE. You can provide a xed
Hierarchy Ancestor
value or use an input parameter to provide the value at runtime.
Distance To Specify a scalar integer value as maximum HIERARCHY_DISTANCE. You can provide a
xed value or use an input parameter to provide the value at runtime.
The Distance From and Distance To values for Hierarchy Ancestor function is always less
than or equal to 0.
Start Rank (Optional) In the value help list, select a START_RANK column that has a data type that can
be cast to BIGINT.
Distance From Specify a scalar integer value as minimum HIERARCHY_DISTANCE. You can provide a xed
Hierarchy
value or use an input parameter to provide the value at runtime.
Descendants
Distance To Specify a scalar integer value as maximum HIERARCHY_DISTANCE. You can provide a
xed value or use an input parameter to provide the value at runtime.
The Distance From and Distance To values for Hierarchy Descendants function is always
greater than or equal to 0.
Start Rank (Optional) In the value help list, select a START_RANK column that has a data type that can
be cast to BIGINT.
Hierarchy Siblings Start Rank (Optional) In the value help list, select a START_RANK column that has a data type that can
be cast to BIGINT.
6. De ne output columns.
a. On the Mappings tab, select the columns you want to add to the output of the hierarchy function view node.
Note
Some default attributes are calculated by the hierarchy generator function. The navigation function projects all
default attributes calculated by the source hierarchy generator function plus a lateral projection of the
corresponding START record. You must retain all of them as the output columns of this view node and cannot
edit them.
Note
If you want to add all columns of a data source to the output, in the context menu of the data source, choose Add
To Output.
b. Choose (Add).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 61/74
1/10/2020
After creating a hierarchy function view node to navigate hierarchies, you can use hierarchy navigation function results as
inputs to other view nodes. For example, if you want to project only some of the output columns to calculation view output,
then you can use the result of this view node in a projection view node to project only the required columns as output
columns of the calculation view.
b. Choose .
c. Drag the cursor to the view node for which you want to provide the input.
Related Information
Context
SAP HANA supports the methods k-anonymity and differential privacy. To attain the anonymization capabilities, the graphical
calculation view editor provides an anonymization view node. You can use this view node to select the required anonymization
method and to de ne the level of privacy for a data set.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag and drop an anonymize view node to the editor.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
Note
You can add only one table or one view as a data source in an anonymization view node. You can also use other
view nodes (join, projection, aggregation, and so on) as inputs to the anonymize view node, provided you are
using only tables or views as data sources.
Restriction
Do not use input parameters in any of the expressions below the anonymize view nodes.
d. Choose Finish.
4. De ne output columns.
b. On the Mapping pane, select the columns you want to add to the output of the anonymize view node.
Note
If you want to add all columns from the data source to the output, in the context menu of the data source,
choose Add To Output.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 62/74
1/10/2020
5. Select an anonymization method.
Select an anonymization method that you want to use to anonymize the calculation view output.
k-anonymity k-anonymity is an intuitive and widely used method for modifying data for privacy
protection. k-anonymity anonymizes data by generalizing the individual record in a
group of similar records, thus signi cantly reducing the possibility that the individual
can be identi ed.
Differential Privacy Differential privacy anonymizes data by randomizing sensitive information but in a
way that regardless of whether an individual record is included in the data set or not,
the outcome of statistical queries remains approximately the same. Differential
privacy provides formal statistical privacy guarantees.
b. Choose (Add).
b. Choose .
c. Drag the cursor to the view node for which you want to provide the input.
Next Steps
For more information on Anonymization also see, SAP HANA Data Anonymization in the SAP HANA Security Guide for SAP HANA
Platform.
Related Information
Con gure k-Anonymity
Con gure Differential Privacy
Procedure
1. In the Sequence Column dropdown list, select a value.
The tool populates the values in the dropdown list based on the output columns of the anonymization view node. The data
type of sequence columns ( seq column) are INT and BIGINT only.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 63/74
1/10/2020
2. In the k text eld, de ne the required k-value.
The k value is the minimum number of distinct values in the generalization hierarchy of a Quasi-identifying information
column.
The loss parameter helps specify the proportion of records that can be dropped from the results in order to limit the extent
of generalization.
4. In the Quasi Columns pane, choose + to de ne columns that contain the quasi identifying information.
5. For each column and for every distinct column value de ne the generalization hierarchies.
You can de ne new generalization hierarchies, or use an external calculation view to de ne the generalization hierarchies.
6. If you want to de ne a new generalization hierarchy, select a column and choose >.
a. For the selected column, if you want to import all distinct column values to the editor, choose Import Values.
b. If you want to add a new row, in the Details pane, choose (Add Row).
Adding new row helps add a new column value to the generalization hierarchy.
c. If you want to add a new hierarchy level to the column value, in the Details pane select the column value and choose
(Add Level).
For each distinct column value, you can add one or more levels and de ne an hierarchy structure level-by-level. You
can also copy and reuse the hierarchy de nition of a selected column value to another column value.
Remember
Use only string values to de ne the levels. The value for the last level is always *.
7. If you want to copy the hierarchy de nition, in the Details pane select a column value and choose (Copy Hierarchy)
If you want to reuse this copied de nition to one or more column value, select the new column values and choose
(Paste Hierarchy).
9. If you want to use an external calculation view to de ne the generalization hierarchy, then in the Generalization
Hierarchies dropdown list, choose External.
a. In the Column Hierarchy value help, select the calculation view that provides the generalization hierarchy de nition.
By weighting one or more columns in your de nition of k-anonymity, you can adjust the relative importance of different
attributes. This allows you to to in uence the data quality after generalization in the quasi-identifying columns.
11. In the Min Level text eld, enter the required value.
You can restrict the possible generalization levels of quasi-identifying columns by setting a minimum value.
12. In the Max Level text eld, enter the required value.
You can restrict the possible generalization levels of quasi-identifying columns by setting a maximum value.
Related Information
Example: Sequence Column
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 64/74
1/10/2020
The sequence column is a user de ned eld containing (INT or BIGINT) integers of the input table. It follows these rules:
Rule 2: It is monotonic increasing. This means that, same values are not set twice even though they are note present
anymore.
Example
Assume the following table
SeqCol Sickness
1 Cough
2 Cancer
If a new value is inserted, it gets a new unique sequence column value. (Following Rule 1)
SeqCol Sickness
1 Cough
2 Cancer
3 AIDS
SeqCol Sickness
1 Cough
3 AIDS
and insert another entry. In this case, we choose "4" as the next sequence entry. (Following Rule 2)
SeqCol Sickness
1 Cough
3 Cancer
4 Broken Legs
Note
The user is responsible for the maintenance of this column. In the calculation view editor, we only require a reference to this
column.
Procedure
1. In the Sequence Column dropdown list, select a value.
The tool populates the values in the dropdown list based on the output columns of the anonymization view node. The data
type of sequence columns ( seq column) are INT and BIGINT only.
This is the value epsilon (ɛ). Typical values are 0.1 or 0.01. However, for some use cases, setting epsilon to a value larger
than 1, for example 5, is ne as well. eε is the maximum multiplicative impact on the probability of any outcome. The lower
the value of epsilon, the greater the privacy required and the more noise is applied.
Sensitivity is typically range of values. Choosing the correct sensitivity is necessary to guarantee differential privacy.
Setting the sensitivity higher than necessary will reduce the quality of the anonymized data.
4. In the Noised Column dropdown list, select the required column value.
Context
Table functions are user-de ned functions that accepts multiple inputs, but returns exactly one result table. The inputs are scalar
inputs or table type inputs.
You can use a table function as a data source directly within a view node (for example, a projection view node, aggregation view
node, and more). But, with SAP HANA 2.0 SPS 01 onwards, you can also use the new table function view node to model table
functions with both, tabular input parameters and scalar input parameters.
In table function view nodes, you can add a table function type, and use other data sources or output of other view nodes to ll the
tabular input parameters of the table function. You can create input parameters or constants in the table function view node to ll
the scalar input parameters of the table function.
After modeling a table function, you can use the output of the table function as inputs to other view nodes in the calculation view.
Procedure
1. Open the required calculation view in the view editor.
2. From the tool palette of the editor, drag a table function view node to the editor.
Have at least one table function type in the table function view node. The table function inputs the table type de nition
along with its columns and scalar parameters.
c. In the Find Data Sources dialog box, enter the name of the table function and select it from the list.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 66/74
1/10/2020
d. Choose OK.
Add tables (data sources) that provides inputs to the table function. You can also add a view node from the calculation view
as an input to the table function view node.
c. In the Find Data Sources dialog box, enter the name of the data source and select it from the list.
d. Choose Finish.
5. De ne input columns.
Map the columns and parameters from the data source with columns and scalar parameters of the table function
respectively.
c. Select the required column from the data source that you want to add as input columns to the table function.
Note
Map columns with matching data types.
Create new input columns and assign it with constant values. You can map constants with scalar input parameters of the
table function.
d. Choose OK.
You can create both input parameters and variables within the table function view node. But, you can map only input
parameters with scalar input parameters of the table function.
b. Choose (Add).
You can see the output columns of the table function view node in the Columns tab.
b. Choose .
c. Drag the cursor to the view the node for which you want to provide the input.
Related Information
Create Input Parameters
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 67/74
1/10/2020
Assign Variables
Context
For example, you could apply lters to retrieve sales of a product where (revenue >= 100 AND region = India) OR (revenue >=50
AND region = Germany). You can also de ne lters using nested or complex expressions.
Filters on columns are equivalent to the HAVING clause of SQL. Filters help optimize the calculation view execution. At runtime,
the system executes the lters after performing all the operations de ned in the lower view nodes.
You can de ne lters on columns using a lter expression, and can use the column engine language or the SQL language to de ne
the lter expression.
Procedure
1. Open the required calculation view in the view editor.
Note
You cannot apply lter on output columns of the graph nodes, table function view nodes, non-equi join view nodes,
anonymize view nodes, or hierarchy function view nodes of a calculation view.
Apply lters on output columns of a view node to lter its output results.
d. In the expression editor, enter the expression that de nes the required lter conditions.
Use the elements, functions, and operators in the Filter Expression tab to build your expression.
For example,
(revenue >= 100 AND region = India) OR (revenue >=50 AND region = Germany)
Tip
In the expression editor, the tool provides hints for all supported functions. The hints give you more information
on the functions, its purpose, and syntax.
If you have modeled a calculation view in which you are using the same view node as an input to multiple other view nodes,
you can push down the lters de ned in the top node to the lower nodes at execution.
a. Select the view node that is used as inputs in multiple view nodes.
c. In the Properties section for the view node, select the Ignore Multiple Output for Filters checkbox.
Note
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 68/74
1/10/2020
Ignore multiple output is described with this example.
If you have de ned a lter in ViewNode_1, the default behavior of the engine is to not push down the lters to the lower
nodes (ViewNode_3). This behavior is to avoid any impact to results of ViewNode_2. You can override this behavior by
setting the Ignore Multiple Output for Filters ag in ViewNode_3. Setting this ag pushes down the lter de ned in
ViewNode_1 to ViewNode_3.
If you have modeled a calculation view with a rank node as an input to any of the top nodes, and if you have de ned a lter
on the top node, you can push down the lter to nodes below the rank node at execution.
c. In the Properties section of the rank node, choose Allow Filter Push Down.
Context
In the fuzzy search parameter de nition, you de ne the fuzzy search string and the required fuzzy score. Fuzzy search is a fast and
fault-tolerant search feature for SAP HANA. A fuzzy search returns records even if the search term contains additional or missing
characters or other types of spelling errors.
For example, you can create a fuzzy search parameter FP with con dence as 0.8 and default search string as Softwar, and
apply the search parameter on the attribute column, CATEGORY. At runtime, the SQL query includes a placeholder,
"$$FP$$"=>'Softwar', and as a result, it returns data for the category values as Software, Softwares, Softwar, and similar.
Procedure
1. Open the required calculation view in the view editor.
2. Double-click the view node in which you want to de ne the fuzzy search parameters.
You can de ne more than one fuzzy search parameter for a calculation view.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 69/74
1/10/2020
a. In the Name text eld, provide a name for the parameter.
b. In the Default Search String textbox, enter the required search string.
c. In the Con dence text eld, enter the required fuzzy score.
You can either use a xed value between 0 to 1 as the fuzzy score, or use an input parameter to de ne the fuzzy
score value at runtime. In the value help, choose the required type with which you want to provide the fuzzy score
value.
Select the attribute columns on which you want to perform the fuzzy search. The tool lters and projects the attribute
column values based on the search string and the fuzzy score de ned in the fuzzy search parameter.
Note
You can perform fuzzy search only for attribute columns in the projection view nodes. In addition, you can perform fuzzy
search only on tables as data sources. This means that, the selected projection view node must have only tables as the
data source.
a. Double-click the required projection view node in which you want to assign the parameters.
c. Select the required fuzzy search parameter and the corresponding attribute column on which you want to perform
the fuzzy search.
You can use the value help to select one or more attribute columns. If you have selected more than one attribute
column, then the tool performs a logical OR of all attribute columns.
d. Choose + to assign another fuzzy parameter to the same or different attribute columns.
If you have assigned more than one fuzzy search parameter to the same attribute column, then the tool performs a
logical AND of all parameters.
Cube Calculation views with data category Cube are visible to the reporting tools and support data analysis with
multidimensional reporting.
For graphical calculation views with data category as Cube, the tool provides aggregation as the default view node.
Also, an additional aggregation column behavior is available that you can use to specify the aggregation types for
measures.
Dimension Calculation views with a data category Dimension are not visible to the reporting tools and do not support data
analysis. However, you can use these calculation views as data sources in other calculation views for any
multidimensional reporting purposes.
If the data category is Dimension, you cannot create measures. You can only consume them with SQL. For example,
you can use such calculation views to ll simple-list user interfaces, where recurring attribute values are not a
problem, but are desired. The output node offers only attributes of numerical data types.
For graphical calculation views with data category Dimension, the tool provides projection as the default view node.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 70/74
1/10/2020
SQL Access Only Calculation views with data category SQL Access Only are not visible to the reporting tools and do not support
multidimensional reporting.
However, you can use these calculation views as data sources in other calculation views for any multidimensional
reporting purposes.
For graphical calculation views with data category SQL Access Only, the tool provides projection as the default view
node.
If you change the data category of the view from CUBE or DIMENSION to SQL ACCESS ONLY and if the view is
directly accessed by a front end tool, then validate whether your front-end tool can still report on the respective view.
Note
Do not change to data category "SQL ACCESS ONLY" if you have explicitly modeled hierarchies in the Semantics
node. For more information, see 2821857
Related Information
Create Graphical Calculation Views
The keep ag property for attribute columns in uence the result set of a calculation view.
For example, consider the expression, a⊕b + c⊕d ≠ (a+c) ⊕ (b+d), where ⊕ is an operator:
In this expression: If ⊕ = +, then the keep ag property is not relevant because, a+b+c+d = (a+c)+(b+d).
But, in the expression, if ⊕ = *, then the keep ag property is relevant. a*b+c*d ≠ (a+c)*(b+d)=a*b+a*d+c*b+c*d.
Example
The following is an example where order of execution matters. Different results occur depending on whether the aggregations are
executed rst, or if the calculations are executed before the aggregations.
1 2 3
1 3 4
2 1 3
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 71/74
1/10/2020
1 5 7 35
2 1 3 3
1 2 3 6
1 3 4 12
2 1 3 3
1 5 7 18
2 1 3 3
Context
The tool provides multiple preview options. You can preview output data of calculation views in simple tabular format, or you can
preview output data in graphical representations such as, bar graphs, area graphs, and pie charts. If your calculation view is
de ned with hierarchies, then the tool allows you to preview the output data in hierarchical representations.
You can also export and download the output data to .csv les. The tool also allows you to preview the SQL query that the tool
executed to fetch the output data.
Procedure
1. Start SAP Web IDE in a Web browser.
2. In the Workspace view, select the required calculation view to preview its output.
If you have de ned any input parameters in the calculation view, provide the required input parameter values.
b. Provide values for the From and To elds based on the selected operator.
In the Raw Data tab, the tool displays the output data in tabular format.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 72/74
1/10/2020
a. If you want to apply lters on columns and preview the ltered output data, in the toolbar, choose (Add Filter).
d. Choose Apply.
b. In the Delimiter dropdown list, select the required delimiter that the tool must use to separate the values in the .csv
le.
c. Choose Download.
a. If you want to view the SQL query that the tool executed to fetch the data, in the toolbar, choose SQL.
b. In you want to view, edit and execute the SQL query in SQL editor, choose (Edit SQL Statement in SQL
Console).
The tool supports bar graph, area graph, pie chart and table charts, and other graphical representations to preview the
output of a calculation view. These graphical representations allow more detailed analysis of output data.
b. Con gure the axis values by dragging and dropping the required attributes and measures to the Label Axis and the
Value Axis.
The tool displays the output data in graphical representation. Select the required chart icons in the menu to view
the output in different graphical representation.
d. If you want to view the query SQL query that the tool executed to fetch the data for the provided axes
con gurations, in the toolbar, choose SQL.
e. If you want to export the charts as .png les to your local system, in the toolbar, choose (Download) and select
Chart.
f. If you want to export the raw output data as .csv les to your local system, in the toolbar, choose (Download)
and select Data.
The SAP Database explorer provides a Hierarchies tab to preview output of calculation views that contain hierarchies. If
you have de ned any hierarchies in calculation views of type Dimension or Cube, you can preview output in hierarchical
tree structures.
Note
The tool does not support preview output of compound parent-child hierarchies in calculation views.
In the Available Objects pane, the tool displays all hierarchies de ned in the calculation view including hierarchies
from shared dimensions, if any. It also displays the measures de ned in the calculation view.
Restriction
The tool does not support preview of multiple hierarchies at the same time. You can preview output in
hierarchical tree structure of only one hierarchy at a time.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 73/74
1/10/2020
c. (Optional) If you want to preview the output with one or more measures from the calculation view, drag and drop the
measure to the Selected Measure(s) pane.
The tool constructs the output data in hierarchical tree structure for the selected con guration. The root node is
expanded and the number of records displayed depends on the MDX console or SQL console settings.
Note
MDX queries do not support history enabled parameters and does not obey any pruning settings de ned for the
calculation view. Thus, they are not part of the hierarchy data preview.
d. If you are previewing output of a calculation view with data category as CUBE and if you want to view the MDX query
that the tool executed to fetch the output data, in the toolbar, choose MDX.
e. If you are previewing output of a calculation view with data category as Dimension and if you want to view the SQL
query that the tool executed on the BIMC tables to fetch the output data, in the toolbar, choose SQL.
f. If you want to export the output data to a .csv le, in the toolbar, choose (Download).
If you have activated the calculation view, you can also preview the output of any of its intermediate view nodes. This
preview helps know the output data that is passed to the higher view node levels.
b. In the Workspace view, select the required calculation view and open it in the view editor.
c. Right-click the required intermediate view node and choose Data Preview.
Related Information
Create Graphical Calculation Views
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20467161&topics=92143ac2a1c5460688c5a7177b… 74/74