You are on page 1of 516

HA300

SAP HANA Modeling

Publication ID:
SAP Copyrights and Trademarks

© 2016 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be
liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and
functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise,
or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from
expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing
decisions.
Course Overview

Unit 1: Information Views

Unit 2: Modeling Functions

Unit 3: SQL Script and Procedures

Unit 4: Virtual Data Models in SAP HANA

Unit 5: Text, Spatial and Predictive Modeling

Unit 6: Management and Administration of Models

Unit 7: Security in SAP HANA Modeling

Unit 8: Optimization of Models


Unit 1: Information Views

Lesson 1: Introducing Information Views

Lesson 2: Connecting Tables

Lesson 3: Creating Dimension Calculation Views

Lesson 4: Working with Measures in Calculation Views

Lesson 5: Understanding the Deprecated Graphical Views


HA300 Unit 1 Lesson 1

Lesson 1: Introducing Information Views

Lesson Objectives
After completing this lesson, you will be able to:

● Explain the key vocabulary used in modeling

● Explain what Information Views are and describe the main types of information views
HA300 Unit 1 Lesson 1

Lesson Agenda
Learn About:
● Key Vocabulary of Modeling

● Information Views in SAP HANA

● Types of Information Views

● Graphical Calculation Views

● Supported Data Source Types in Graphical Calculation Views

● Script-Based Calculation Views

● Calculation Views and the SAP HANA Engines

● Querying Calculation Views in SAP HANA Studio


HA300 Unit 1 Lesson 1

Lesson Agenda
Do:
● Prepare your SAP HANA System
HA300 Table 1: Measure vs. Attribute Unit 1 Lesson 1

Measure Attribute
Definition A numeric value, such as a price, An element that is used to describe
quantity, volume, on which you can a measure.
process arithmetic/statistics oper-
ations, such as sum, average, top n
values, and calculations.
Examples
● Number of products sold ● Product ID
● Unit Price ● Product Name
● Total Price ● Customer ID
● Customer Name
● Sales Organization
● Sales Org. Country
HA300 Unit 1 Lesson 1

● Sales Org. Region


● Currency
HA300 Figure 1: Dimensions Unit 1 Lesson 1
HA300 Figure 2: Star Schema Unit 1 Lesson 1
HA300 Figure 3: The Hierarchy Concept Unit 1 Lesson 1
HA300 Figure 4: Information Views Unit 1 Lesson 1
HA300 Figure 5: Design Time vs. Runtime Information Unit 1 Lesson 1
View
HA300 Figure 6: Analytical vs. Transactional Unit 1 Lesson 1
Requirements
HA300 Figure 7: Types of Information Views Unit 1 Lesson 1
HA300 Figure 8: Graphical Calculation View Types Unit 1 Lesson 1
HA300 Figure 9: Dimension Calculation Views Unit 1 Lesson 1
HA300 Figure 10: Virtual Data Models for Unit 1 Lesson 1
Multidimensional Scenarios
HA300 Figure 11: Virtual Data Models for Normalized Unit 1 Lesson 1
Data
HA300 Unit 1 Lesson 1

Main Supported Data Sources Types in Calculation Views


● Row and Column Tables from the same database
● Row and Column Tables from another database of the same HANA System, in a
Multi Database Container configuration

● Core Data Services (CDS) Entities


● SQL Views
● Graphical Calculation Views
Note that only Calculation Views of type DIMENSION are supported in the Star Join
node of a Calculation View.

● Calculation Views from another database of the same HANA System, in a MDC
configuration
There are some limitations to this support. For example, “remote” DIMENSION
Calculation Views cannot be used in the Star-Join of a Calculation View.

● Table Functions
HA300 Unit 1 Lesson 1

Main Supported Data Sources Types in Calculation Views


● Decision Tables
● Virtual Tables (data provisioned through SAP HANA Smart Data Access)
● Analytic Views (deprecated)
● Script-based Calculation Views (deprecated)
HA300 Unit 1 Lesson 1

Identifying Column Tables and Row Tables


● From the Systems view catalog
- Check the table icon
- Open the table definition (right-click the table and choose Open Definition)
● Within a node in an information view that consumes the table
- Check the the table icon
- Check the Properties view
● From the SQL Console
- Query the system table M_TABLES
Example:
SELECT "SCHEMA_NAME", "TABLE_NAME", "TABLE_TYPE" FROM "M_TABLES"
WHERE "SCHEMA_NAME" = 'TRAINING'
AND "TABLE_NAME" = 'SALES_DATA'
HA300 Unit 1 Lesson 1

Main SAP HANA Engines to execute Calculation Views


● Join Engine
● OLAP Engine
● Calculation Engine
HA300 Figure 12: Calculation View Optimization Unit 1 Lesson 1
HA300 Figure 13: Standard Preview or Custom Query Unit 1 Lesson 1
HA300

Summary
You should now be able to:

● Explain the key vocabulary used in modeling


● Explain what Information Views are and describe the main types of information
views
HA300 Unit 1 Lesson 2

Lesson 2: Connecting Tables

Lesson Objectives
After completing this lesson, you will be able to:

● Explain the differences between the SAP HANA join types

● Know when to use which type of join when connecting tables


HA300 Unit 1 Lesson 2

Lesson Agenda
Learn About:
● Connecting Tables

● Inner Join

● Left outer join

● Right Outer Join

● Full Outer Join

● Referential Join

● Text Join

● Star join

● Spatial Join
HA300 Unit 1 Lesson 2

Lesson Agenda
● Join Cardinality

● Combining Several Data Sets: Union vs. Join


HA300 Figure 24: Sample Data for Business Example Unit 1 Lesson 2
HA300 Figure 25: Join Type Summary Unit 1 Lesson 2
HA300 Figure 26: Inner Join in a Dimension Calculation Unit 1 Lesson 2
View
HA300 Figure 27: Inner Join in a Cube Calculation View Unit 1 Lesson 2
HA300 Figure 28: Left Outer Join in a DIMENSION Unit 1 Lesson 2
Calculation View
HA300 Figure 29: Left Outer Joins and Design Time Unit 1 Lesson 2
Filters
HA300 Figure 30: Left Outer Joins in a CUBE Calculation Unit 1 Lesson 2
View
HA300 Figure 31: Right Outer Join in a DIMENSION Unit 1 Lesson 2
Calculation View
HA300 Figure 32: Right Outer Join in a CUBE Calculation Unit 1 Lesson 2
View
HA300 Figure 33: Full Outer Join Unit 1 Lesson 2
HA300 Figure 34: Referential Join Unit 1 Lesson 2
HA300 Figure 35: Referential Joins in a CUBE Calculation Unit 1 Lesson 2
View
HA300 Figure 36: Text Joins Unit 1 Lesson 2
HA300 Figure 37: Text Join Example Unit 1 Lesson 2
HA300 Figure 38: Star Join Unit 1 Lesson 2
HA300 Figure 39: Validating a Join Unit 1 Lesson 2
HA300 Figure 40: Do NOT Combine Data Sets with Joins Unit 1 Lesson 2
in Calculation Views
HA300

Summary
You should now be able to:

● Explain the differences between the SAP HANA join types


● Know when to use which type of join when connecting tables
HA300 Unit 1 Lesson 3

Lesson 3: Creating Dimension Calculation Views

Lesson Objectives
After completing this lesson, you will be able to:

● Create Dimension Calculation Views

● Define calculated attributes

● Create time-based dimension views

● Use base table aliases

● Define label columns and hide attributes in a Dimension Calculation View


HA300 Unit 1 Lesson 3

Lesson Agenda
Learn About:
● Dimension Calculation Views

● Calculated Attributes

● Time-Based Dimension Calculation Views

● Base Table Aliases

● Hidden Columns

● General Properties of Views

Learn:
● How to Create a Time Dimension Calculation View
HA300 Unit 1 Lesson 3

Lesson Agenda
Do:
● Create a Dimension Calculation View
HA300 Figure 41: Shared Attribute Views Unit 1 Lesson 3
HA300 Figure 42: Calculated Columns Unit 1 Lesson 3
HA300 Figure 43: Time-Based Dimension Calculation Unit 1 Lesson 3
Views
HA300 Unit 1 Lesson 3

Types of Calendars in Time Calculation Views


● Gregorian
The Gregorian calendar is made up of years, months, and days. You can adjust the
level of granularity, down to hours, minutes or seconds.

● Fiscal
The fiscal calendar is organized into fiscal years and fiscal periods. Several fiscal
year variants can be defined depending on your reporting needs.
HA300 Figure 44: Adding Multiple Base Tables Using Unit 1 Lesson 3
Aliases
HA300 Figure 45: Hidden Columns Unit 1 Lesson 3
HA300 Figure 46: Label Columns and Hidden Attributes Unit 1 Lesson 3
HA300 Table 2: General Properties of Views Unit 1 Lesson 3

Property Description
Data Category For Calculation Views, determines whether the view supports mul-
ti-dimensional reporting.
Type Standard, Time or Derived *
Base Attribute View* For a derived Attribute View, identifies the source Attribute View
from which it is derived.
Default Client Defines how to filter data by SAP client (MANDT).
Run With Defines how to apply security when executing a script-based calcu-
lation view.
Default Schema Defines which schema must be used when the source schema of a
catalog object is not specified.
Apply Privileges Specifies the type of Analytic Privileges (Standard or SQL) to apply
when executing a view.
Enable History The value of this property determines whether your calculation
view supports time travel queries.
HA300 Unit 1 Lesson 3

Property Description
History Input Param- Specifies which Input Parameter must be used to specify the time-
eter stamp in time travel queries.
Column View Name This field contains the full name of the column view in the _SYS_BIC
schema. You can easily copy/paste this name to the code of a SQL
statement.
Deprecate Identifies views that are not recommended for reuse, though still
supported in SAP HANA Modeler.
Cache Defines whether the data retrieved by the view should be cached.
Cache Invalidation If the view data are cached, determines whether the cache must be
Period deleted on a daily or hourly basis, or after each transaction that
modifies any of the underlying tables.
Translate Determines whether the view labels can be translated into one or
several additional languages.
Execute in Determines whether the model must be executed by the SQL en-
gine or column engine.
HA300 Unit 1 Lesson 3

Property Description
Pruning Configura- Identifies which table contains the settings to prune Union nodes.
tion Table
HA300

Summary
You should now be able to:

● Create Dimension Calculation Views


● Define calculated attributes
● Create time-based dimension views
● Use base table aliases
● Define label columns and hide attributes in a Dimension Calculation View
HA300 Unit 1 Lesson 4

Lesson 4: Working with Measures in Calculation Views

Lesson Objectives
After completing this lesson, you will be able to:

● Explain how to handle measures in Calculation Views

● Explain the benefits of each type of node in calculation views

● Create and combine nodes in Calculation views in the most relevant way

● Maintain nodes, calculations, and semantics by using specific productivity features


HA300 Unit 1 Lesson 4

Lesson Agenda
Learn About:
● Measures in Calculation Views

● Overview of the Possible Nodes Types

● The Projection Node

● The Join Node

● The Star Join Node

● The Union Node

● The Aggregation Node

● Controlling the Behavior of the Aggregation Node

● The Rank Node


HA300 Unit 1 Lesson 4

Lesson Agenda
● Specific Features to Enhance Flexibility of Calculation Views Design

● Data Lineage

Do:
● Create a CUBE with Star Join Calculation View

● Combine Two Data Sources with a Union Node

● Control the Behavior of the Aggregation Node

● Extract Top N Values with a Calculation View


HA300 Figure 52: Standard Preview or Custom Query Unit 1 Lesson 4
HA300 Figure 53: Types of Nodes in Graphical Unit 1 Lesson 4
Calculation Views
HA300 Figure 54: Dynamic Join Unit 1 Lesson 4
HA300 Figure 55: Star join Unit 1 Lesson 4
HA300 Figure 56: Union Node Unit 1 Lesson 4
HA300 Figure 57: Standard Union Unit 1 Lesson 4
HA300 Figure 58: Union with Constant Values Unit 1 Lesson 4
HA300 Figure 59: Unmapped Columns in a Union Node Unit 1 Lesson 4
HA300 Figure 60: Union Node Pruning Unit 1 Lesson 4
HA300 Figure 69: Aggregation Node Unit 1 Lesson 4
HA300 Figure 70: Keep Flag Unit 1 Lesson 4
HA300 Figure 71: Transparent Filter Unit 1 Lesson 4
HA300 Figure 72: Rank Node Unit 1 Lesson 4
HA300 Unit 1 Lesson 4

Rank Column: Measure or Attribute?


● Attribute
Assigning the type Attribute is a simple approach.
It is probably a bit less error-prone, because you are not tempted to perform an
irrelevant aggregation of ranking positions. Removing the rank column from the
top query will just apply the defined aggregate function, very often SUM, to the
ranked values of each partition.

● Measure
With the type Measure, the rank column provides more flexibility.
For example, if you set the default aggregate function to MAX, you can retrieve
summarized data, such as the total sales generated by the five biggest orders in
each country, while keeping the information about how many orders are actually
totalled in each country. Indeed, there might be countries that have received less
than five orders over the considered period, and this information could be of
interest when analyzing the data.
HA300 Figure 73: Useful Features for Calculation View Unit 1 Lesson 4
Definition
HA300 Figure 74: Data Lineage Unit 1 Lesson 4
HA300

Summary
You should now be able to:

● Explain how to handle measures in Calculation Views


● Explain the benefits of each type of node in calculation views
● Create and combine nodes in Calculation views in the most relevant way
● Maintain nodes, calculations, and semantics by using specific productivity features
HA300 Unit 1 Lesson 5

Lesson 5: Understanding the Deprecated Graphical Views

Lesson Objectives
After completing this lesson, you will be able to:

● Explain Attribute Views and Analytic Views (Deprecated View Types)


HA300 Unit 1 Lesson 5

Lesson Agenda
Learn About:
● Deprecated Graphical Calculation Views

● Features from Deprecated Views Not Supported in Calculation Views

● Scenario in Attribute and Analytic Views

● Join Behavior by Type of Information Views


HA300 Figure 75: Deprecated Graphical Calculation Unit 1 Lesson 5
Views
HA300 Table 4: Functional Difference between Unit 1 Lesson 5
Information Views Types

Feature Available only in Comments


Fuzzy Search Attribute Views It is possible to enable one or several columns of an
Attribute Views for Fuzzy Search. This is not possible
in Calculation Views
Temporal Join Star Join node of It is possible to join a fact table (Data Foundation)
Analytic Views and the corresponding master data (Attribute View)
based on temporal conditions.
Derived Attribute Attribute Views If an Attribute View must be used several times in the
View same Analytic View, you can create a Derived Attrib-
ute View. This is a “dynamic” copy of the base Attrib-
ute View.
HA300 Figure 76: Temporal Join Unit 1 Lesson 5
HA300 Figure 77: Derived Attribute View – Example Unit 1 Lesson 5
HA300 Figure 78: Creating Derived Attribute Views Unit 1 Lesson 5
HA300 Figure 79: Attribute View Scenario Unit 1 Lesson 5
HA300 Figure 80: Analytic View Scenario Unit 1 Lesson 5
HA300 Unit 1 Lesson 5

Functional Limitations in the Data Foundation in Analytic Views


● Limited Types of Data Source
The Data Foundation of an Analytic View cannot be defined on row tables, or other
information models (column views).The main data source type is Column Tables.

● Facts can only originate from one table.


You cannot select measures from several tables of the Data Foundation.
HA300 Figure 81: Join Behavior in Different Information Unit 1 Lesson 5
Views
HA300

Summary
You should now be able to:

● Explain Attribute Views and Analytic Views (Deprecated View Types)


Unit 2: Modeling Functions

Lesson 1: Using Hierarchies

Lesson 2: Creating Restricted and Calculated Columns

Lesson 3: Filtering Data

Lesson 4: Using Variables and Input Parameters

Lesson 5: Implementing Currency Conversion

Lesson 6: Creating Decision Tables


HA300 Unit 2 Lesson 1

Lesson 1: Using Hierarchies

Lesson Objectives
After completing this lesson, you will be able to:

● Implement level hierarchies

● Create parent-child hierarchies

● Work with time-based hierarchies


HA300 Unit 2 Lesson 1

Lesson Agenda
Learn About:
● The Hierarchy Concept

● Level Hierarchies

● Parent Child Hierarchies

● Drill Down Enablement

● Overview of the SAP BI Tools that Support SAP HANA Hierarchies


HA300 Unit 2 Lesson 1

Lesson Agenda
Do:
● Implement a Level Hierarchy

● Implement a Parent-Child Hierarchy

● Implement a Time-Dependent Hierarchy


HA300 Figure 82: Choosing Hierarchy Type Unit 2 Lesson 1
HA300 Figure 83: Hierarchy comparison Unit 2 Lesson 1
HA300 Figure 84: Implement Level Hierarchies (I) Unit 2 Lesson 1
HA300 Figure 85: Implement Level Hierarchies (II) Unit 2 Lesson 1
HA300 Figure 86: Implement Level Hierarchies (III) Unit 2 Lesson 1
HA300 Figure 87: Implement Level Hierarchies (IV) Unit 2 Lesson 1
HA300 Table 5: Node Styles Unit 2 Lesson 1

Level Style Output Example


Level Name Level and node name MONTH.JAN
Name Only Node name only JAN
Name Path Node name and its ancestors FISCAL_2015.QUAR-
TER_1.JAN
HA300 Figure 88: Defining the Nodes of a Parent-Child Unit 2 Lesson 1
Hierarchy
HA300 Figure 89: Advanced Properties of a Parent-Child Unit 2 Lesson 1
Hierarchy
HA300 Figure 90: Defining Time Dependent Hierarchies Unit 2 Lesson 1
HA300 Figure 91: Drill Down Enablement in MDX Unit 2 Lesson 1
HA300 Figure 92: SAP BI Tools Support for Hierarchies Unit 2 Lesson 1
HA300

Summary
You should now be able to:

● Implement level hierarchies


● Create parent-child hierarchies
● Work with time-based hierarchies
HA300 Unit 2 Lesson 2

Lesson 2: Creating Restricted and Calculated Columns

Lesson Objectives
After completing this lesson, you will be able to:

● Describe the benefits of Restricted Columns and Calculated Columns

● Create Restricted Columns

● Create Calculated Columns


HA300 Unit 2 Lesson 2

Lesson Agenda
Learn About:
● Restricted Columns

● Calculated Columns

Do:
● Create Restricted and Calculated Measures
HA300 Figure 110: The Benefits of Restricted Columns Unit 2 Lesson 2
HA300 Figure 111: Example Without Using a Restricted Unit 2 Lesson 2
Column
HA300 Figure 112: Creating Restricted Columns Unit 2 Lesson 2
HA300 Figure 113: Setting the Restriction Unit 2 Lesson 2
HA300 Figure 114: Displaying and Editing Restriction Unit 2 Lesson 2
Expression
HA300 Figure 115: When to Use Calculated Columns Unit 2 Lesson 2
HA300 Figure 116: When to use Calculated Columns Unit 2 Lesson 2
HA300 Figure 117: Calculated Columns Wizard Unit 2 Lesson 2
HA300 Figure 118: Consider Granularity when Creating Unit 2 Lesson 2
Calculated Columns
HA300 Figure 119: Triggering Calculations at the Right Unit 2 Lesson 2
Level
HA300 Figure 120: Calculation Before Aggregation Unit 2 Lesson 2
HA300 Figure 121: Calculate Before Aggregation Option Unit 2 Lesson 2
in Analytic Views
HA300 Figure 122: Client Side Aggregation Unit 2 Lesson 2
HA300

Summary
You should now be able to:

● Describe the benefits of Restricted Columns and Calculated Columns


● Create Restricted Columns
● Create Calculated Columns
HA300 Unit 2 Lesson 3

Lesson 3: Filtering Data

Lesson Objectives
After completing this lesson, you will be able to:

● Describe the difference between Filters and WHERE clauses

● Create client dependent views

● Restrict data by using domain fix values


HA300 Unit 2 Lesson 3

Lesson Agenda
Learn About:
● Using Filter Operations

● Comparing Filters and WHERE Clauses

● Client Dependent Views

● Domain Fix Values

Do:
● Define and Use Filters
HA300 Figure 128: Filter Operations Unit 2 Lesson 3
HA300 Figure 129: Comparing Filters and WHERE Unit 2 Lesson 3
Clauses
HA300 Figure 130: Create Client Dependent Views Unit 2 Lesson 3
HA300 Unit 2 Lesson 3

View Behavior when the User has no Assigned CLIENT


● In Calculation Views:
The view does not retrieve any data

● In Analytic Views:
The view retrieves data for all CLIENT values. That is, behaves as if its Default Client
property were set to Cross Client.
HA300 Unit 2 Lesson 3

Session Dependent Functions


● SESSION_CONTEXT('CLIENT')
Returns the client's value based on the current user profile.

● SESSION_CONTEXT('LOCALE')
Returns the session's language in POSIX format (set by 'locale' parameter of
JDBC/ODBC/ODBO connection, for example, en_en, de_de, de_at).

● SESSION_CONTEXT('LOCALE_SAP')
Returns the session's language following the SAP internal format (like the SPRAS
column in the text tables of Master Data).
HA300 Figure 131: Restricting Domain Fix Values Using Unit 2 Lesson 3
Text Join
HA300

Summary
You should now be able to:

● Describe the difference between Filters and WHERE clauses


● Create client dependent views
● Restrict data by using domain fix values
HA300 Unit 2 Lesson 4

Lesson 4: Using Variables and Input Parameters

Lesson Objectives
After completing this lesson, you will be able to:

● Explain the difference between variables and input parameters

● Create variables and use them to filter data

● Create input parameters


HA300 Unit 2 Lesson 4

Lesson Agenda
Learn About:
● Variables and Input Parameters

● Difference Between Variables and Input Parameters

● Variables

● Input parameters

Do:
● Use Variables and Input Parameters
HA300 Figure 134: Variables Compared to Input Unit 2 Lesson 4
Parameters (I)
HA300 Figure 135: Variables Compared to Input Unit 2 Lesson 4
Parameters (II)
HA300 Figure 136: Impact of Variables and Input Unit 2 Lesson 4
Parameters
HA300 Figure 137: Variables Types Unit 2 Lesson 4
HA300 Figure 138: Creating Variables (I) Unit 2 Lesson 4
HA300 Figure 139: Creating Variables (II) Unit 2 Lesson 4
HA300 Figure 140: Creating Variables (III) Unit 2 Lesson 4
HA300 Figure 141: Input Parameter Use Cases Unit 2 Lesson 4
HA300 Figure 142: Input Parameter Types Unit 2 Lesson 4
HA300 Figure 143: Creating Input Parameters Unit 2 Lesson 4
HA300 Figure 144: Calling an Input Parameter in a Unit 2 Lesson 4
Calculation
HA300 Figure 145: Input Parameter Using Dates Unit 2 Lesson 4
HA300 Figure 146: Using a Calendar Dialog for Date Unit 2 Lesson 4
Input Parameters
HA300 Figure 147: Passing Parameters to External Views Unit 2 Lesson 4
for Value Help
HA300

Summary
You should now be able to:

● Explain the difference between variables and input parameters


● Create variables and use them to filter data
● Create input parameters
HA300 Unit 2 Lesson 5

Lesson 5: Implementing Currency Conversion

Lesson Objectives
After completing this lesson, you will be able to:

● Explain the general principles of Currency Conversion

● Apply Currency Conversion in Calculation Views

● Apply different methods to define source and target currencies


HA300 Unit 2 Lesson 5

Lesson Agenda
Learn About:
● The Rationale for Currency Conversion in Data Reporting

● Native Currency Conversion in SAP HANA Information Models

● The TCUR Schema

● Implementing Conversion in Calculation Views

Do:
● Implement Currency Conversion in a Calculation View
HA300 Figure 148: Currency Conversion Unit 2 Lesson 5
HA300 Figure 149: Currency Conversion Unit 2 Lesson 5
HA300 Figure 150: Currency Conversion in SAP HANA Unit 2 Lesson 5
HA300 Figure 151: Currency Conversion in SAP HANA Unit 2 Lesson 5
HA300 Figure 152: Required Conversion Tables Unit 2 Lesson 5
HA300 Figure 153: Currency Conversion Process Flow Unit 2 Lesson 5
HA300 Figure 154: Currency Conversion in Calculation Unit 2 Lesson 5
Views
HA300 Figure 155: Currency Conversion in Calculation Unit 2 Lesson 5
Views - Using Currency Conversion
HA300 Figure 156: Currency Conversion in Calculation Unit 2 Lesson 5
Views
HA300 Figure 157: Currency Conversion in Calculation Unit 2 Lesson 5
Views - Using Currency Conversion
HA300 Figure 158: Exchange Types and Dates Unit 2 Lesson 5
HA300 Figure 159: Leverage Fixed Currencies Unit 2 Lesson 5
HA300 Figure 160: Using Fixed Currencies Unit 2 Lesson 5
HA300 Figure 161: Leverage Source Currency from Unit 2 Lesson 5
Attribute
HA300 Figure 162: Leverage Source Currency from Unit 2 Lesson 5
Attribute
HA300 Figure 163: Defining an Attribute-Dependent Unit 2 Lesson 5
Source Currency
HA300 Figure 164: Decimal Shifts and Error Handling Unit 2 Lesson 5
HA300 Figure 165: User Selected Target Currency Unit 2 Lesson 5
HA300 Figure 166: Creating an Input Parameter Unit 2 Lesson 5
HA300 Figure 167: Setting the Input Parameter as Target Unit 2 Lesson 5
Currency
HA300 Figure 168: Create Target Currency Input Unit 2 Lesson 5
Parameter - Using Currency Conversion
HA300

Summary
You should now be able to:

● Explain the general principles of Currency Conversion


● Apply Currency Conversion in Calculation Views
● Apply different methods to define source and target currencies
HA300 Unit 2 Lesson 6

Lesson 6: Creating Decision Tables

Lesson Objectives
After completing this lesson, you will be able to:

● Describe decision automation using Business Rules on SAP HANA

● Create Decision Tables

● Consume Decision Tables in Calculation Views


HA300 Unit 2 Lesson 6

Lesson Agenda
Learn About:
● Turning Business Rules into Decision Tables

Do:
● Create a Decision Table
HA300 Figure 169: Decision Tables Overview Unit 2 Lesson 6
HA300 Figure 170: Business Examples Unit 2 Lesson 6
HA300 Figure 171: Helping Driving Agility Unit 2 Lesson 6
HA300 Figure 172: Different Users Unit 2 Lesson 6
HA300 Figure 173: Creation Workflow Unit 2 Lesson 6
HA300 Figure 174: Decision Table Graphical Editor Unit 2 Lesson 6
HA300 Figure 175: Activities to be Performed in the Data Unit 2 Lesson 6
Foundation Node
HA300 Figure 176: Vocabulary, Conditions, and Actions Unit 2 Lesson 6
HA300 Figure 177: Business Rules inside SAP HANA Unit 2 Lesson 6
HA300 Figure 178: How to Execute a Decision Table in Unit 2 Lesson 6
SQLScript
HA300 Figure 179: Executing a Decision Table on Real Unit 2 Lesson 6
Data
HA300 Figure 180: Decision Table Modeled on a Table Unit 2 Lesson 6
Type
HA300 Figure 181: Creation Workflow - Create a Decision Unit 2 Lesson 6
Table in a Package
HA300 Figure 182: Creation Workflow - Define the Data Unit 2 Lesson 6
Foundation
HA300 Figure 183: Creation Workflow - Define Business Unit 2 Lesson 6
Rules
HA300 Figure 184: Creation Workflow - Explore, Unit 2 Lesson 6
Simulate, and Adapt
HA300

Summary
You should now be able to:

● Describe decision automation using Business Rules on SAP HANA


● Create Decision Tables
● Consume Decision Tables in Calculation Views
Unit 3: SQL Script and Procedures

Lesson 1: Introducing SAP HANA SQL

Lesson 2: Working with SQLScript

Lesson 3: Creating and Using Procedures

Lesson 4: Working with the SQL Debug Tools

Lesson 5: Understanding the Deprecated SQL Modeling Objects


HA300 Unit 3 Lesson 1

Lesson 1: Introducing SAP HANA SQL

Lesson Objectives
After completing this lesson, you will be able to:

● Explain the language elements used in SAP HANA SQL statements


HA300 Unit 3 Lesson 1

Lesson Agenda
Learn About:
● SAP HANA SQL - Definition and Terminology

● Identifiers

● Data Types

● Predicates

● Operators

● Functions

● Expressions

● Creating Tables
HA300 Unit 3 Lesson 1

Lesson Agenda
Do:
● Configure the System for SQL Activities

● Work with SQL Statements


HA300 Figure 188: SQL - Structured Query Language Unit 3 Lesson 1
HA300 Figure 189: SQL Console Unit 3 Lesson 1
HA300 Figure 190: SQL Console Autocomplete Unit 3 Lesson 1
HA300 Figure 191: SQL Language Elements Unit 3 Lesson 1
HA300 Figure 192: Comment and Code Page Unit 3 Lesson 1
HA300 Figure 193: Identifiers Unit 3 Lesson 1
HA300 Figure 194: SQL Data Types Unit 3 Lesson 1
HA300 Figure 195: SQL Predicates Unit 3 Lesson 1
HA300 Figure 196: Operators Unit 3 Lesson 1
HA300 Figure 197: Functions Unit 3 Lesson 1
HA300 Figure 198: Expressions Unit 3 Lesson 1
HA300 Figure 199: Expressions: Examples Unit 3 Lesson 1
HA300 Figure 200: SQL statement: Create Table Unit 3 Lesson 1
HA300 Figure 201: Create Table - Table Types Unit 3 Lesson 1
HA300 Figure 202: Create Table - Syntax Elements Unit 3 Lesson 1
HA300 Figure 203: SQL statement: Insert Unit 3 Lesson 1
HA300 Figure 204: SQL statement: Select Unit 3 Lesson 1
HA300

Summary
You should now be able to:

● Explain the language elements used in SAP HANA SQL statements


HA300 Unit 3 Lesson 2

Lesson 2: Working with SQLScript

Lesson Objectives
After completing this lesson, you will be able to:

● Define SQLScript and SQLScript extensions

● Explain the SQLScript implementation logic

● Convert a scripted Calculation View into a Table Function


HA300 Unit 3 Lesson 2

Lesson Agenda
Learn About:
● Introducing SQLScript

● Control Statements and Dynamic SQL

● User Defined Function

● Read Hierarchies via SQL

Do:
● Create a Scripted Calculation View and Migrate it to a Table Function

● Read a Hierarchy Structure with SQL


HA300 Figure 206: SQLScript: Concept Unit 3 Lesson 2
HA300 Figure 207: ANSI-92 and SQLScript Data Types Unit 3 Lesson 2
HA300 Figure 208: SQLScript: Data Type Extensions Unit 3 Lesson 2
HA300 Unit 3 Lesson 2

Using Variables in SQLScript


● Declare a variable
DECLARE <variable_name> <type> [NOT NULL] [= <value>]
Example 1: DECLARE a int;
Example 2: DECLARE b int = 0; (the value is assigned when creating the
variable)

● Assign a variable (define the value of a variable)


<variable_name> = <value> or <expression>
Example 1: a = 3;
Example 2: b = select count(*) from baseTable;

● Use a variable in an expression


:<variable_name> (with a colon) returns the current value of the variable
Example: b = :a + 5; (assigns the value of a + 5 to b)
HA300 Figure 209: The IF Statement Unit 3 Lesson 2
HA300 Figure 210: WHILE and FOR Loops Unit 3 Lesson 2
HA300 Figure 211: The EXEC Statement Unit 3 Lesson 2
HA300 Unit 3 Lesson 2

Built-In Procedures to Secure Dynamic SQL


● ESCAPE_SINGLE_QUOTES (string_var)
Used for variables containing a SQL string literal

● ESCAPE_DOUBLE_QUOTES (string_var)
Used for variables containing a delimited SQL identifier

● IS_SQL_INJECTION_SAFE(string_var[, num_tokens])
Used to check that a variable contains safe simple SQL identifiers (up to
num_tokens, default is 1)
HA300 Figure 212: Table Functions Unit 3 Lesson 2
HA300 Figure 213: Migrating Scripted Calculation Views Unit 3 Lesson 2
HA300 Figure 214: The Scripted Calculation View Unit 3 Lesson 2
Migration Tool
HA300 Figure 223: Enabling Hierarchies for SQL Access Unit 3 Lesson 2
HA300 Figure 224: Aggregating Values in a Hierarchy via Unit 3 Lesson 2
SQL
HA300

Summary
You should now be able to:

● Define SQLScript and SQLScript extensions


● Explain the SQLScript implementation logic
● Convert a scripted Calculation View into a Table Function
HA300 Unit 3 Lesson 3

Lesson 3: Creating and Using Procedures

Lesson Objectives
After completing this lesson, you will be able to:

● Describe the benefits of procedures

● Create a procedure

● Call a procedure
HA300 Unit 3 Lesson 3

Lesson Agenda
Learn About:
● Introduction to SQLScript Procedures

● Creating a Procedure

● Calling a Procedure

● Calling a Procedure from a Script-Based Calculation View

● Activating Design-Time Procedures and Table Types

Do:
● Create a Procedure
HA300 Figure 227: Procedures Unit 3 Lesson 3
HA300 Figure 228: Procedures - Key Properties Unit 3 Lesson 3
HA300 Figure 229: SQLScript: Procedure Creation using Unit 3 Lesson 3
SQL Editor - SQLScript and Procedures
HA300 Figure 230: Creating a Procedure using the Unit 3 Lesson 3
Modeler Wizard
HA300 Figure 231: Defining Parameters and Script Unit 3 Lesson 3
HA300 Figure 232: Calling a Procedure Unit 3 Lesson 3
HA300 Figure 233: Calling a Procedure with Overview Unit 3 Lesson 3
HA300 Figure 234: Calling a Procedure Unit 3 Lesson 3
HA300

Summary
You should now be able to:

● Describe the benefits of procedures


● Create a procedure
● Call a procedure
HA300 Unit 3 Lesson 4

Lesson 4: Working with the SQL Debug Tools

Lesson Objectives
After completing this lesson, you will be able to:

● Use SQLScript Debug Tools


HA300 Unit 3 Lesson 4

Lesson Agenda
Learn About:
● The SQLScript Debug Tools

● The Debug Perspective

● Required Authorizations to Debug a Procedure

Learn:
● To Debug a Procedure

Watch:
● How to Debug a Design-Time Procedure
HA300 Unit 3 Lesson 4

Main Features of the Debug Tool in SAP HANA Studio


● Debug both catalog and repository procedures
● Set breakpoints in the procedure code to debug step-by-step
● Display the value of scalar and table variables at any breakpoint
● Debug sub-procedures called by the main one on-the-fly
● Store several debug configurations for the same procedure and apply them during
a new debug session
HA300 Figure 237: The Debug Perspective Unit 3 Lesson 4
HA300

Summary
You should now be able to:

● Use SQLScript Debug Tools


HA300 Unit 3 Lesson 5

Lesson 5: Understanding the Deprecated SQL Modeling Objects

Lesson Objectives
After completing this lesson, you will be able to:

● Know the basics about deprecated modeling objects

● Explain deprecated CE Functions


HA300 Unit 3 Lesson 5

Lesson Agenda
Learn About:
● Scripted Calculation Views - Former Approach

● New Trend for Scripted Modeling - CE Functions Deprecated

● CE Plan Operators

● Data Source Access Operators

● Relational Operators
HA300 Figure 238: Calculation Engine Unit 3 Lesson 5
HA300 Figure 239: Calculation Model Example Unit 3 Lesson 5
HA300 Figure 240: Calculation Engine Plan Operators Unit 3 Lesson 5
HA300 Figure 241: SQLScript: Data Source Access Unit 3 Lesson 5
Operators
HA300 Figure 242: SQLScript: Data Source Access Unit 3 Lesson 5
Operators
HA300 Figure 243: SQLScript: Data Source Access Unit 3 Lesson 5
Operators
HA300 Figure 244: SQLScript: Data Source Access Unit 3 Lesson 5
Operators
HA300 Figure 245: SQLScript: Relational Operators Unit 3 Lesson 5
HA300 Figure 246: SQLScript: Relational Operators Unit 3 Lesson 5
HA300 Figure 247: SQLScript: Relational Operators Unit 3 Lesson 5
HA300 Figure 248: SQLScript: Relational Operators Unit 3 Lesson 5
HA300 Figure 249: SQLScript: Relational Operators Unit 3 Lesson 5
HA300

Summary
You should now be able to:

● Know the basics about deprecated modeling objects


● Explain deprecated CE Functions
Unit 4: Virtual Data Models in SAP HANA

Lesson 1: Getting Started with SAP HANA Live

Lesson 2: Understanding the Virtual Data Model

Lesson 3: Discovering and Consuming SAP HANA Live Views

Lesson 4: Modifying SAP HANA Live Models

Lesson 5: Building a Virtual Data Model with CDS Views


HA300 Unit 4 Lesson 1

Lesson 1: Getting Started with SAP HANA Live

Lesson Objectives
After completing this lesson, you will be able to:

● Describe SAP HANA Live


HA300 Unit 4 Lesson 1

Lesson Agenda
Learn About:
● What is SAP HANA Live?
HA300 Figure 250: What is SAP HANA Live? Unit 4 Lesson 1
HA300 Figure 251: SAP HANA Live - What it is not Unit 4 Lesson 1
HA300 Figure 252: SAP HANA Live - Comprehensive Unit 4 Lesson 1
Suite Coverage
HA300 Figure 253: SAP HANA Live Combined with SAP Unit 4 Lesson 1
BW
HA300 Figure 254: Two Deployment Options for SAP Unit 4 Lesson 1
HANA Live
HA300

Summary
You should now be able to:

● Describe SAP HANA Live


HA300 Unit 4 Lesson 2

Lesson 2: Understanding the Virtual Data Model

Lesson Objectives
After completing this lesson, you will be able to:

● Describe the architecture of SAP HANA Live


HA300 Unit 4 Lesson 2

Lesson Agenda
Learn About:
● SAP HANA Live VDM Architecture

Do:
● Explore the SAP HANA Live Virtual Data Model
HA300 Figure 255: Detailed SAP HANA Live VDM Unit 4 Lesson 2
Architecture
HA300 Figure 256: Virtual Data Model Unit 4 Lesson 2
HA300

Summary
You should now be able to:

● Describe the architecture of SAP HANA Live


HA300 Unit 4 Lesson 3

Lesson 3: Discovering and Consuming SAP HANA Live Views

Lesson Objectives
After completing this lesson, you will be able to:

● Discover and consume SAP HANA Live views


HA300 Unit 4 Lesson 3

Lesson Agenda
Learn About:
● Discovering SAP HANA Live views

● Consuming SAP HANA Live Views

Do:
● Discover SAP HANA Live Views

● Consume SAP HANA Live Views


HA300 Figure 258: SAP HANA Live Browser - Description Unit 4 Lesson 3
HA300 Figure 259: SAP HANA Live Browser - Unit 4 Lesson 3
Architecture
HA300 Figure 260: Explore the Metadata and Content of Unit 4 Lesson 3
a Model
HA300 Figure 261: SAP HANA Live Browser - Features Unit 4 Lesson 3
HA300 Figure 275: What is SAP BI? Unit 4 Lesson 3
HA300 Figure 276: Rapid Deployment Solutions for SAP Unit 4 Lesson 3
HANA Live
HA300 Figure 277: Real-Time Analytical Applications Unit 4 Lesson 3
HA300 Figure 278: Goods Receipts / Invoice Receipts Unit 4 Lesson 3
Clearing
HA300 Figure 279: Days Sales Outstanding Unit 4 Lesson 3
HA300 Figure 280: GRC Analytics - Overview Unit 4 Lesson 3
HA300 Figure 281: Overview of Consumption Unit 4 Lesson 3
Architecture
HA300

Summary
You should now be able to:

● Discover and consume SAP HANA Live views


HA300 Unit 4 Lesson 4

Lesson 4: Modifying SAP HANA Live Models

Lesson Objectives
After completing this lesson, you will be able to:

● Modify SAP HANA Live views using standard SAP HANA studio tools

● Use the SAP HANA Live Extension Assistant


HA300 Unit 4 Lesson 4

Lesson Agenda
Learn About:
● Overview

● Using the Extension Assistant


Do:
● Extend a View using the SAP HANA Live Extension Assistant
HA300 Figure 286: Modifying SAP HANA Live views — Unit 4 Lesson 4
Outline
HA300 Figure 287: Examples of Modifications to SAP Unit 4 Lesson 4
HANA Live Views
HA300 Figure 288: Modifying SAP HANA Live views — Unit 4 Lesson 4
Guidelines
HA300 Figure 289: Hiding attributes not removing them Unit 4 Lesson 4
HA300 Figure 290: Extension Assistant Unit 4 Lesson 4
HA300 Figure 291: New or Existing Extension Unit 4 Lesson 4
HA300 Figure 292: Extension Assistant restrictions Unit 4 Lesson 4
HA300

Summary
You should now be able to:

● Modify SAP HANA Live views using standard SAP HANA studio tools
● Use the SAP HANA Live Extension Assistant
HA300 Unit 4 Lesson 5

Lesson 5: Building a Virtual Data Model with CDS Views

Lesson Objectives
After completing this lesson, you will be able to:

● Describe CDS views


HA300 Unit 4 Lesson 5

Lesson Agenda
Learn About:
● What is a CDS View?

● Two Types of CDS View

● CDS View Creation

● CDS Views and Native SAP HANA Modeling


HA300 Figure 298: CDS View Concept Unit 4 Lesson 5
HA300 Figure 299: VDM using CDS Views Unit 4 Lesson 5
HA300 Figure 300: Languages of CDS Views Unit 4 Lesson 5
HA300 Figure 301: Example of Adding Semantics for Unit 4 Lesson 5
Different Domains
HA300

Summary
You should now be able to:

● Describe CDS views


Unit 5: Text, Spatial and Predictive Modeling

Lesson 1: Implementing Full Text Search and Text Analysis

Lesson 2: Defining Full Text Indexes

Lesson 3: Using Full Text Search

Lesson 4: Working with Geospatial Data

Lesson 5: Developing Predictive Models


HA300 Unit 5 Lesson 1

Lesson 1: Implementing Full Text Search and Text Analysis

Lesson Objectives
After completing this lesson, you will be able to:

● Explain the Full Text Search capabilities of SAP HANA

● Invoke the text search processes

● Create a Fuzzy Search

● Explain Text Analysis


HA300 Unit 5 Lesson 1

Lesson Agenda
Learn About:
● Introduction to Full Text Search

● Additional Features and Components to Leverage Full-Text Search

● Overview of Text Analysis

● Introduction to Text Mining

Watch:
● How to Use Text Analysis and Text Mining
HA300 Figure 302: Full Text Search Unit 5 Lesson 1
HA300 Figure 303: What is Fuzzy Search? Unit 5 Lesson 1
HA300 Figure 304: SAP HANA Full Text Search Unit 5 Lesson 1
HA300 Figure 305: Full Text Search Benefits Unit 5 Lesson 1
HA300 Figure 306: Full Text Search Processes Unit 5 Lesson 1
HA300 Figure 307: Full Text Search Processes Unit 5 Lesson 1
HA300 Figure 308: Full Text Search Processes Unit 5 Lesson 1
HA300 Figure 309: Full Text Search UI Toolkit Unit 5 Lesson 1
HA300 Figure 310: Full-Text Index, Search Models, and Unit 5 Lesson 1
Data Access
HA300 Figure 311: SAP HANA File Loader Unit 5 Lesson 1
HA300 Figure 312: Text Analysis Unit 5 Lesson 1
HA300 Figure 313: Example of Text Analysis Features Unit 5 Lesson 1
HA300 Figure 314: Text Analysis Language Support Unit 5 Lesson 1
HA300 Figure 315: Text Mining Overview Unit 5 Lesson 1
HA300 Figure 316: Exploring Terms and Documents Unit 5 Lesson 1
HA300 Figure 317: Syntax Example Unit 5 Lesson 1
HA300 Figure 318: Executing Queries Unit 5 Lesson 1
HA300

Summary
You should now be able to:

● Explain the Full Text Search capabilities of SAP HANA


● Invoke the text search processes
● Create a Fuzzy Search
● Explain Text Analysis
HA300 Unit 5 Lesson 2

Lesson 2: Defining Full Text Indexes

Lesson Objectives
After completing this lesson, you will be able to:

● Describe the concept of Full Text indexes

● Explain which data types can be indexed for Full Text Search

● Enable columns for Full Text Search in SAP HANA tables


HA300 Unit 5 Lesson 2

Lesson Agenda
Learn About:
● Full Text Indexes

● Search Options in Modeling


HA300 Figure 319: Supported Data Types Unit 5 Lesson 2
HA300 Figure 320: Full Text Indexes Unit 5 Lesson 2
HA300 Figure 321: Full Text Indexes Unit 5 Lesson 2
HA300 Figure 322: Enabling a Fuzzy Search Index on Unit 5 Lesson 2
TEXT or SHORTTEXT
HA300 Figure 323: Enabling a Fuzzy Search Index on Unit 5 Lesson 2
Other Data Types
HA300 Figure 324: Monitoring the Indexing Process Unit 5 Lesson 2
HA300 Figure 325: Viewing Binary Content Unit 5 Lesson 2
HA300 Figure 326: Enabling Search Options for Modeling Unit 5 Lesson 2
HA300 Figure 327: Search Properties in an Information Unit 5 Lesson 2
Model
HA300

Summary
You should now be able to:

● Describe the concept of Full Text indexes


● Explain which data types can be indexed for Full Text Search
● Enable columns for Full Text Search in SAP HANA tables
HA300 Unit 5 Lesson 3

Lesson 3: Using Full Text Search

Lesson Objectives
After completing this lesson, you will be able to:

● Use Full Text Search

● Use Fuzzy Search

● Explain Fuzzy Search relevance scoring

● Use Freestyle Search


HA300 Unit 5 Lesson 3

Lesson Agenda
Learn About:
● Using Full Text Search in SQL

● Enabling Fuzzy Search

● Additional Features

Do:
● Use Full Text Search
HA300 Figure 328: Full Text Search SQL Syntax Unit 5 Lesson 3
HA300 Figure 329: Full Text Search SQL Syntax Unit 5 Lesson 3
HA300 Figure 330: Fuzzy Search Relevance Score Unit 5 Lesson 3
HA300 Figure 331: String Type Fuzzy Search Unit 5 Lesson 3
HA300 Figure 332: Text Type Fuzzy Search Unit 5 Lesson 3
HA300 Figure 333: Fuzzy Search SQL Syntax Unit 5 Lesson 3
HA300 Figure 334: Freestyle Search SQL Syntax Unit 5 Lesson 3
HA300 Figure 335: Further Full Text Search Syntax – Unit 5 Lesson 3
Highlighting and Snippets
HA300 Figure 336: Further Full Text Search Syntax – Unit 5 Lesson 3
Why Found and Faceted Search
HA300

Summary
You should now be able to:

● Use Full Text Search


● Use Fuzzy Search
● Explain Fuzzy Search relevance scoring
● Use Freestyle Search
HA300 Unit 5 Lesson 4

Lesson 4: Working with Geospatial Data

Lesson Objectives
After completing this lesson, you will be able to:

● Store geographical data in column tables

● Query geographical data using SQL


HA300 Unit 5 Lesson 4

Lesson Agenda
Learn About:
● Geospatial Data in SAP HANA

● Geographical Data Types

● Creating, Retrieving and Comparing Spatial Data in SAP HANA Tables

● Functions for Spatial Data Comparison

● Geocoding Features

● Using Spatial Joins in Calculation Views and Core Data Services (CDS)

● Other Use Cases for Spatial Functions

Do:
● Use Geospatial Methods and Predicates
HA300 Figure 337: SAP HANA Geospatial Introduction Unit 5 Lesson 4
HA300 Figure 338: Geospatial Features as Part of the Unit 5 Lesson 4
SAP HANA Platform
HA300 Figure 339: Spatial Processing Architecture Unit 5 Lesson 4
HA300 Figure 340: Spatial Data as Part of the Column Unit 5 Lesson 4
Store
HA300 Figure 341: Geographical Data Types Unit 5 Lesson 4
HA300 Figure 342: ST_POINT Data Type Unit 5 Lesson 4
HA300 Figure 343: Spatial Column Creation and Spatial Unit 5 Lesson 4
Data Access
HA300 Table 8: Spatial Data Comparison Function Unit 5 Lesson 4

Spatial Function and Syntax Usage


[geo1].ST_EQUALS([geo2]) Tests if an ST_GEOMETRY value is spatially
equal to another ST_GEOMETRY value.
[geo1].ST_CONTAINS([geo2]) Tests if a geometry value spatially contains
and[geo1].ST_COVERS([geo2]) another geometry value.*
[geo1].ST_WITH­ Tests if a geometry value is spatially con-
IN([geo2])and[geo1].ST_COVERED­ tained within another geometry value.*
BY([geo2])
[geo1].ST_WITHINDISTANCE([geo2], Test if two geometries are within a specified
[distance]) distance of each other.
[geo1].ST_DISTANCE([geo2]) Returns the smallest distance between
specified geometry values.
HA300 Figure 344: Spatial Clustering Overview Unit 5 Lesson 4
HA300 Figure 345: Spatial Clustering — Supported Unit 5 Lesson 4
Algorithms
HA300 Figure 346: Spatial Clustering Example using K- Unit 5 Lesson 4
means Algorithm
HA300 Figure 347: Spatial Functions in Calculation Unit 5 Lesson 4
Views and CDS
HA300 Figure 348: Spatial Joins in Calculation Views Unit 5 Lesson 4
HA300 Figure 349: Spatial Data Use Cases Unit 5 Lesson 4
HA300

Summary
You should now be able to:

● Store geographical data in column tables


● Query geographical data using SQL
HA300 Unit 5 Lesson 5

Lesson 5: Developing Predictive Models

Lesson Objectives
After completing this lesson, you will be able to:

● Develop a predictive model using SAP HANA Predictive Analysis Library


HA300 Unit 5 Lesson 5

Lesson Agenda
Learn About:
● Developing a Predictive Model using SAP HANA PAL

Do:
● Develop a Predictive Model
HA300 Figure 350: Predictive Analysis Examples Unit 5 Lesson 5
HA300 Figure 351: Predictive Analysis Algorithms (1) Unit 5 Lesson 5
HA300 Figure 352: Predictive Analysis Algorithms (2) Unit 5 Lesson 5
HA300 Figure 353: Flowgraph Example Unit 5 Lesson 5
HA300

Summary
You should now be able to:

● Develop a predictive model using SAP HANA Predictive Analysis Library


Unit 6: Management and Administration of Models

Lesson 1: Processing and Analyzing Information Models

Lesson 2: Managing Modeling Content

Lesson 3: Converting Deprecated Information Objects


HA300 Unit 6 Lesson 1

Lesson 1: Processing and Analyzing Information Models

Lesson Objectives
After completing this lesson, you will be able to:

● Validate Information Models

● Compare different versions of an Information Model

● Check model references

● Generate auto documentation

● Execute a Performance Analysis of an Information Model


HA300 Unit 6 Lesson 1

Lesson Agenda
Learn About:
● Validating and Activating Information Models

● Activating Information Models

● Further Details of SAP HANA Models

● Performance Analysis

Do:
● Process Information Models
HA300 Figure 354: Validating Models Unit 6 Lesson 1
HA300 Figure 355: Setting Preferences for Validation Unit 6 Lesson 1
Rules (1)
HA300 Figure 356: Setting Preferences for Validation Unit 6 Lesson 1
Rules (2)
HA300 Figure 357: Executing Validation Rules Unit 6 Lesson 1
HA300 Figure 358: Analyzing Validation Log Unit 6 Lesson 1
HA300 Figure 359: Information Model Lifecycle Unit 6 Lesson 1
HA300 Figure 360: Object Versions - Comparing versions Unit 6 Lesson 1
HA300 Figure 361: Object Versions - View Version Unit 6 Lesson 1
History
HA300 Figure 362: Checking Model References (1) Unit 6 Lesson 1
HA300 Figure 363: Checking Model References (2) Unit 6 Lesson 1
HA300 Figure 364: Auto Documentation Unit 6 Lesson 1
HA300 Figure 365: Auto Documentation - Select Unit 6 Lesson 1
Document Type
HA300 Figure 366: Auto Documentation - Adding Unit 6 Lesson 1
Objects to Target List
HA300 Figure 367: Auto Documentation - Select Export Unit 6 Lesson 1
Type and Save to Location
HA300 Figure 368: Performance Analysis Mode (1) Unit 6 Lesson 1
HA300 Figure 369: Performance Analysis Mode (2) Unit 6 Lesson 1
HA300

Summary
You should now be able to:

● Validate Information Models


● Compare different versions of an Information Model
● Check model references
● Generate auto documentation
● Execute a Performance Analysis of an Information Model
HA300 Unit 6 Lesson 2

Lesson 2: Managing Modeling Content

Lesson Objectives
After completing this lesson, you will be able to:

● Manage schemas and define schema mapping

● Define package-specific authoring schema

● Transport information models between two systems

● Move and copy information models within a system

● Take over an information model edited by another user

● Translate metadata texts


HA300 Unit 6 Lesson 2

Lesson Agenda
Learn About:
● Schema Mapping

● Exporting and Importing Information Models

● Copying Information Models

● Renaming an Information Model

● Moving Information Models

● Taking Over an Information Model - Switch Ownership

● Translating Metadata Texts for Views

Do:
● Define a Schema Mapping
HA300 Unit 6 Lesson 2

Key Vocabulary of Schema Mapping


● Authoring Schema
The schema name in the source system.

● Physical Schema
The schema name in the target system.
HA300 Figure 370: Creating a Schema Unit 6 Lesson 2
HA300 Figure 371: Defining Schema Mapping Unit 6 Lesson 2
HA300 Figure 372: Transporting Tables to a Different Unit 6 Lesson 2
Schema
HA300 Figure 373: Information View with a Table in Unit 6 Lesson 2
Schema HA300
HA300 Figure 374: Schema Mapping and Imported Unit 6 Lesson 2
Analytic View in the Target System
HA300 Figure 375: Schema Mapping - Defining Package- Unit 6 Lesson 2
Specific Authoring Schema
HA300 Figure 376: Delivery Units, Packages and Unit 6 Lesson 2
Information Models
HA300 Figure 377: Export and Import Unit 6 Lesson 2
HA300 Figure 378: HANA Content Transport Capabilities Unit 6 Lesson 2
HA300 Figure 379: Creating a Delivery Unit Unit 6 Lesson 2
HA300 Figure 380: Assigning Packages to a Delivery Unit Unit 6 Lesson 2
HA300 Figure 381: Delivery Unit Properties Unit 6 Lesson 2
HA300 Figure 382: Exporting a Delivery Unit Unit 6 Lesson 2
HA300 Figure 383: Checking List of Exported Packages Unit 6 Lesson 2
and Time Filter
HA300 Figure 384: Importing a Delivery Unit Unit 6 Lesson 2
HA300 Figure 385: Checking List of Imported Models and Unit 6 Lesson 2
Import Actions
HA300 Figure 386: Import and Export – SAP Support Unit 6 Lesson 2
Mode
HA300 Figure 387: Copying Information Objects Unit 6 Lesson 2
HA300 Figure 388: Copying Content Delivered by SAP Unit 6 Lesson 2
HA300 Figure 389: Renaming Information Views Unit 6 Lesson 2
HA300 Figure 390: Moving Information Models Between Unit 6 Lesson 2
Packages
HA300 Figure 391: Taking Over a Content Object from Unit 6 Lesson 2
Another User
HA300 Figure 392: Switch Ownership of Inactive Objects Unit 6 Lesson 2
HA300 Unit 6 Lesson 2

Translating Metadata Texts for Views


● View description
● View nodes
● Elements (columns labels)
● Hierarchies
● Variables and Input Parameters
HA300 Figure 393: Translating View Labels Unit 6 Lesson 2
HA300

Summary
You should now be able to:

● Manage schemas and define schema mapping


● Define package-specific authoring schema
● Transport information models between two systems
● Move and copy information models within a system
● Take over an information model edited by another user
● Translate metadata texts
HA300 Unit 6 Lesson 3

Lesson 3: Converting Deprecated Information Objects

Lesson Objectives
After completing this lesson, you will be able to:

● Convert Attribute and Analytic Views into Calculation Views


HA300 Unit 6 Lesson 3

Lesson Agenda
Learn About:
● Migration Utility for Attribute and Analytic Views

● Migration Log

● General Considerations before a Migration

● How to Secure the Migration

Learn:
● How to Migrate Attribute and Analytic Views into Calculation Views

Do:
● Convert Attribute and Analytic Views to Calculation Views
HA300 Figure 394: Attribute and Analytic Views Unit 6 Lesson 3
Migration Utility
HA300 Unit 6 Lesson 3

Main Information Provided by the Migration Log


● Total number of objects selected for migration.
● Total number of objects successfully converted to new object types.
● List of objects that require user actions before activation.
● List of impacted objects whose references have been adjusted automatically
during migration.
The impacted objects are also converted to the new object type.

● List of impacted objects whose references could not be adjusted automatically.


You will have to manually select such impacted objects and convert them to the
new object types in a new migration step.
HA300 Unit 6 Lesson 3

Object Dependencies and Package Structure


● All the Attribute Views referenced by an Analytic View must be migrated before the
(migrated) Analytic View can be successfully activated.

● A migrated Attribute View (that is, a DIMENSION Calculation View) can be


successfully activated only when all the Analytic Views referencing it have been
migrated.

● The references to migrated objects in Calculation Views are automatically adjusted


during activation, even if the packages containing the Calculation Views are not
selected for migration.
HA300 Unit 6 Lesson 3

Migration Process Recommendation


● Several migration steps can be executed in order to reach a consistent state of all
migrated objects.

● Then all migrated objects can get activated at once.


● This also allows to cancel the migration and revert to the previous status, by
choosing Delete inactive objects from the Quick View.
HA300 Unit 6 Lesson 3

Features with Different Behavior in Calculation Views


● Hidden columns can be made visible during migration (dedicated option in the
migration utility), or they will be missing in the resulting Calculation View.

● The internal row.count column that existed in every Analytic View is made visible in
the resulting Calculation View, as the Count Star Column in its properties.

● A derived Attribute View is converted into a “standalone” DIMENSION Calculation


View, with no dependency to the main view anymore.

● Column Filters in Attribute and Analytic Views are converted to Filter Expressions in
the new Calculation Views

● Input Parameter-based Filters in the Data Foundation of Attribute and Analytic


Views are converted into additional Projection nodes with Filter Expression.

● The Relational Optimization setting in Analytic Views is dropped during migration.


Indeed, the general optimization for Calculation Views is applied.
HA300 Unit 6 Lesson 3

Key Recommendations for the Migration Process


● Take a back-up of all objects before executing the migration
● Start migration with a clean workspace, with all Information Views activated

Note:
If you have inactive objects in your workspace before the migration, they will be
mixed up with the inactive migrated objects, which will make the migration check
more difficult, and prevent a proper migration roll-back.

● Simulate the migration activity before migrating


This is a very convenient way to check the impact of migration without affecting at
all the source Information Views.

● Migrate Information Views before migrating Analytic Privileges


If you plan to migrate both Attribute/Analytic Views to Calculation Views and
Classical Analytic Privileges to SQL Analytic Privileges, the migration should be
done in two distinct steps. Information Views first, then Analytic Privileges.
HA300 Unit 6 Lesson 3

Key Recommendations for the Migration Process


● Undoing migration changes is only possible before activating the objects
HA300

Summary
You should now be able to:

● Convert Attribute and Analytic Views into Calculation Views


Unit 7: Security in SAP HANA Modeling

Lesson 1: Understanding Roles and Privileges

Lesson 2: Defining Privileges

Lesson 3: Generating SAP HANA Live Privileges

Lesson 4: Migrating Analytic Privileges


HA300 Unit 7 Lesson 1

Lesson 1: Understanding Roles and Privileges

Lesson Objectives
After completing this lesson, you will be able to:

● Define Roles and Privileges

● Explain how Users, Roles and Privileges are used to implement Objects and Data Access
security in SAP HANA
HA300 Unit 7 Lesson 1

Lesson Agenda
Learn About:
● Overview of User Management and Security

● Users, Roles and Privileges

Do:
● Work with SAP HANA Users and Roles
HA300 Figure 395: User Management and Security in Unit 7 Lesson 1
SAP HANA
HA300 Figure 396: Users, Roles, Objects and Privileges Unit 7 Lesson 1
HA300 Figure 397: Defining a Hierarchy of Roles and Unit 7 Lesson 1
Privileges
HA300 Table 9: Catalog Roles vs. Repository Roles Unit 7 Lesson 1

Feature Catalog Roles Repository Roles


Transportability No Yes
Version Management No Yes
Relationship to database Each role is owned by the da- All roles are owned by the
users tabase user that created it. technical user _SYS_REPO.
Grant and revoke process Roles are granted by the da- Roles are granted and re-
tabase user with the SQL voked using built-in proce-
GRANT statement. dures. An EXECUTE privilege
on these procedures is the
only authorization needed to
grant or revoke any role.
HA300 Figure 398: Assigning Privileges by SQL or HANA Unit 7 Lesson 1
Studio UI
HA300 Figure 399: Managing Users and Roles Unit 7 Lesson 1
HA300

Summary
You should now be able to:

● Define Roles and Privileges


● Explain how Users, Roles and Privileges are used to implement Objects and Data
Access security in SAP HANA
HA300 Unit 7 Lesson 2

Lesson 2: Defining Privileges

Lesson Objectives
After completing this lesson, you will be able to:

● Describe the different types of privileges

● Explain how to grant the relevant privileges to the Modeler and End-User
HA300 Unit 7 Lesson 2

Lesson Agenda
Learn About:
● Types of Privileges

● System Privileges Applicable to the Modeler Role

● Package Privileges

● Object Privileges Applicable to the Modeler or End-User Roles

● Analytic Privileges

● SQL Analytic Privileges

● Dynamic Analytic Privileges

● Defining Data Access Security with Nested Information Views

● Managing Authorizations on Activated Content


HA300 Unit 7 Lesson 2

Lesson Agenda
● Summary of Privileges Required for the Modeler and End-User

Do:
● Create and Assign Analytic Privileges
HA300 Figure 401: Authorization Concept - Types of Unit 7 Lesson 2
Privileges
HA300 Figure 402: System Privileges Unit 7 Lesson 2
HA300 Figure 403: Object Privilege Unit 7 Lesson 2
HA300 Figure 404: Package Privileges Unit 7 Lesson 2
HA300 Figure 405: System Privileges Relevant for the Unit 7 Lesson 2
Modeler Role
HA300 Figure 406: Package Privileges Unit 7 Lesson 2
HA300 Figure 407: Native and Imported Package Unit 7 Lesson 2
Privileges
HA300 Figure 408: Analytic Privileges Unit 7 Lesson 2
HA300 Unit 7 Lesson 2

Two Flavors of Analytic Privileges


● Classical Analytic Privileges (also called XML-based Analytic Privileges)
This is the historical Data Access restriction type, which now tends to be
deprecated and replaced with the SQL–based one.

● SQL Analytic Privileges


This new type of Analytic Privilege has been introduced with SAP HANA SPS10. It
provides more flexibility in scenarios where filter conditions are complex.
HA300 Figure 409: Analytic Privilege - Start Creation Unit 7 Lesson 2
Wizard
HA300 Figure 410: Analytic Privilege - Select Information Unit 7 Lesson 2
Models
HA300 Figure 411: Analytic Privilege - Editor Overview Unit 7 Lesson 2
HA300 Figure 412: Analytic Privilege - Select Column for Unit 7 Lesson 2
Attribute Restriction
HA300 Figure 413: Activating Analytic Privileges Unit 7 Lesson 2
HA300 Figure 414: Analytic Privilege Check Unit 7 Lesson 2
HA300 Unit 7 Lesson 2

Key Benefits of SQL Analytic Privileges.


● High flexibility to support complex filtering scenarios, in a familiar SQL
environment

● Possibility to define attribute restrictions based on hierarchies, by selecting a


hierarchy node

● Possibility to create Analytic Privileges in two steps:


- First, by choosing Attributes and defining Restrictions for each of them, like
in a Classical Analytic Privilege.

- Then (optionally), by converting the corresponding restrictions into a SQL


Statement, and adding SQL-based custom restrictions.

● Possibility to secure data access to Core Data Services (CDS) artefacts, in


particular CDS Views.
HA300 Figure 415: Securing CDS Views with SQL Unit 7 Lesson 2
Analytic Privileges Image
HA300 Figure 416: Hierarchy-Based Restrictions in SQL Unit 7 Lesson 2
Analytic Privileges
HA300 Figure 417: Dynamic Analytic Privileges - Concept Unit 7 Lesson 2
HA300 Unit 7 Lesson 2

Using Procedures in Dynamic Analytic Privileges


● In a Classic Analytic Privilege
- Each attribute can have a dynamic definition based on a procedure.
- You can combine fixed and procedure-based filtering conditions on different
attributes (for example, a fixed range of dates and a procedure-based range
of countries or products).

● In a SQL Analytic Privilege


- Only one procedure is used by the Analytic Privilege.
- This procedure must returns a character string that is a SQL WHERE clause
defining the different columns and the restricted values.
For example, "COUNTRY"='US' AND "YEAR"='2016'.
HA300 Unit 7 Lesson 2

Classical Dynamic Analytic Privilege - Procedure Parameters


● No input parameters
● 1 output parameter of type Table with one single column, for the In operator
● 1 output parameter of a scalar type for all unary operators, such as Equal
● 2 output parameters of a scalar type for the binary operator Between
HA300 Figure 418: Classical Dynamic Analytic Privilege - Unit 7 Lesson 2
Example
HA300 Unit 7 Lesson 2

SQL Analytic Privilege - Procedure Properties


● Procedure must be read-only
● Security mode must be DEFINER
● No input parameters
● Only one scalar output parameter of type VARCHAR(256) or NVARCHAR(256)
HA300 Figure 419: Nested Information Views - Data Unit 7 Lesson 2
Access Security Principles
HA300 Figure 420: Data Access Security in SAP HANA Unit 7 Lesson 2
Live
HA300 Figure 421: Managing Authorizations on Unit 7 Lesson 2
Activated Content
HA300 Figure 422: Summary of Required Privileges for Unit 7 Lesson 2
the Modeler Role (1)
HA300 Figure 423: Summary of Required Privileges for Unit 7 Lesson 2
the Modeler Role (2)
HA300

Summary
You should now be able to:

● Describe the different types of privileges


● Explain how to grant the relevant privileges to the Modeler and End-User
HA300 Unit 7 Lesson 3

Lesson 3: Generating SAP HANA Live Privileges

Lesson Objectives
After completing this lesson, you will be able to:

● Generate SAP HANA Live privileges using the Analytics Authorization Assistant
HA300 Unit 7 Lesson 3

Lesson Agenda
Learn About:
● Generating SAP HANA Live Privileges from SAP BusinessSuite

● Using SAP HANA Live Analysis Authorization Assistant

Do:
● Generate an Analytic Privilege from an ABAP System
HA300 Figure 424: Authorisation Assistant — Outline Unit 7 Lesson 3
HA300 Figure 425: Authorisation Assistant — Rationale Unit 7 Lesson 3
HA300 Figure 426: SAP HANA Live Analysis Unit 7 Lesson 3
Authorization Assistant Tools
HA300 Figure 427: Generate Analytic Privileges Unit 7 Lesson 3
HA300 Figure 428: Update Analytic Privileges Unit 7 Lesson 3
HA300 Figure 429: Adding Custom Authorization Unit 7 Lesson 3
Metadata
HA300

Summary
You should now be able to:

● Generate SAP HANA Live privileges using the Analytics Authorization Assistant
HA300 Unit 7 Lesson 4

Lesson 4: Migrating Analytic Privileges

Lesson Objectives
After completing this lesson, you will be able to:

● Convert Classical Analytic Privileges to SQL-Based Analytic Privileges


HA300 Unit 7 Lesson 4

Lesson Agenda
Learn About:
● Using the Migrate Utility
HA300 Figure 460: Migrating Analytic Privileges Unit 7 Lesson 4
HA300 Unit 7 Lesson 4

Key Recommendations for the Migration Process


● Take a back-up of all objects before executing the migration
● Start migration with a clean workspace, with all Information Views activated
● Migrate Information Views before migrating Analytic Privileges
If you plan to migrate both Attribute/Analytic Views to Calculation Views and
Classical Analytic Privileges to SQL Analytic Privileges, the migration should be
done in two distinct steps. Information Views first, then Analytic Privileges.

● Undoing migration changes is only possible before activating the objects


HA300

Summary
You should now be able to:

● Convert Classical Analytic Privileges to SQL-Based Analytic Privileges


Unit 8: Optimization of Models

Lesson 1: Applying Good Modeling Approaches

Lesson 2: Understanding the Cost of SQL Statements


HA300 Unit 8 Lesson 1

Lesson 1: Applying Good Modeling Approaches

Lesson Objectives
After completing this lesson, you will be able to:

● Apply good modeling approaches to SAP HANA


HA300 Unit 8 Lesson 1

Lesson Agenda
Learn About:
● Different Types of Engines for Data Processing

● Best Practices for Data Modeling

● SQL Execution of Calculation Views

● Best Practices when Writing SQL


HA300 Figure 461: SAP HANA Engine Overview Unit 8 Lesson 1
HA300 Figure 462: SAP HANA Engine Overview II Unit 8 Lesson 1
HA300 Figure 463: General Modeling Principles Unit 8 Lesson 1
HA300 Figure 464: Filter and Aggregation Push Down Unit 8 Lesson 1
HA300 Figure 465: Using Dedicated Value Help Views or Unit 8 Lesson 1
Tables
HA300 Figure 466: Execute in SQL Engine Unit 8 Lesson 1
HA300 Figure 467: SQL Best Practices 1 Unit 8 Lesson 1
HA300 Figure 468: SQL Best Practices 2 Unit 8 Lesson 1
HA300 Figure 469: SQL Best Practices 3 Unit 8 Lesson 1
HA300 Figure 470: SQL Best Practices 4 Unit 8 Lesson 1
HA300

Summary
You should now be able to:

● Apply good modeling approaches to SAP HANA


HA300 Unit 8 Lesson 2

Lesson 2: Understanding the Cost of SQL Statements

Lesson Objectives
After completing this lesson, you will be able to:

● Understand the cost of SQL Statements


HA300 Unit 8 Lesson 2

Lesson Agenda
Learn About:
● Understanding the cost of SQL statements

Do:
● Use Explain Plan

● Use Visualize Plan

● Use the Timeline view


HA300 Figure 471: Explain Plan Unit 8 Lesson 2
HA300 Figure 472: Plan Visualize Flow — Prepare phase Unit 8 Lesson 2
HA300 Figure 473: Plan Visualize Execute — Overview Unit 8 Lesson 2
tab
HA300 Figure 474: Plan Visualize Execute — Executed Unit 8 Lesson 2
Plan tab
HA300 Figure 475: Timeline View Unit 8 Lesson 2
HA300

Summary
You should now be able to:

● Understand the cost of SQL Statements

You might also like