SAP HANA Modeling Guide - SAP Help Portal · PDF fileSAP HANA Modeling Guide ... A calculation view allows users to define more advanced slices on the data available in the SAP HANA

Embed Size (px)

Citation preview

  • PUBLIC

    SAP HANA Platform 2.0 SPS 00Document Version: 1.0 2016-11-30

    SAP HANA Modeling GuideFor SAP HANA XS Advanced Model

  • Content

    1 Creating a Graphical Calculation View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.1 Attributes and Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2 Create Graphical Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    Create Graphical Calculation Views with Star Joins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9Create Graphical Calculation Views with Time Dimension. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Supported View Nodes for Modeling Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Working With View Nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Supported Data Categories for Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    1.3 Preview Calculation View Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    2 Working With Attributes and Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472.1 Create Counters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472.2 Create Calculated Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.3 Create Restricted Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502.4 Assign Semantics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    Extract and Copy Semantics From Underlying Data Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . 52Propagate Columns to Semantics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Supported Semantic Types for Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Supported Semantic Types for Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    2.5 Assign Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Supported Variable Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    2.6 Create Input Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Map Input Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Input Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

    2.7 Using Hierarchies for Reporting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63Create Level Hierarchies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Create Parent-Child Hierarchies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Query Shared Hierarchies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70Orphan Nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Root Node Visibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    2.8 Using Currency and Unit of Measure Conversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Associate Measures with Currency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Associate Measures with Unit of Measure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77Reuse a Currency Conversion or Unit Conversion Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . 80

    2.9 Enable or Disable Attributes for Drilldown in Reporting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812.10 Handle Null Values in Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812.11 Convert Attribute Values to Required Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

    2 P U B L I CSAP HANA Modeling Guide

    Content

  • 2.12 Group Related Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    3 Working With Calculation View Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.1 Filter Data for Specific Clients. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    Default Client Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    3.2 Enable Calculation Views for Time Travel Queries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    3.3 Invalidate Cached Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    Enable Support for Cache Invalidation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    3.4 Deprecate Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    3.5 Quick Reference: Calculation View Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    4 Defining Data Access Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934.1 Create Static SQL Analytic Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    4.2 Create Dynamic SQL Analytic Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    4.3 Create Analytic Privileges Using SQL Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    4.4 Static SQL Analytic Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    4.5 Dynamic SQL Analytic Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    5 Additional Functionality for Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005.1 Trace View Objects with Data Lineage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100

    5.2 Trace Dependent Objects to Analyze Impacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    5.3 Assign Value Help for Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    5.4 Performance Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    Open Calculation Views in Performance Analysis Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

    Debug Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

    5.5 Maintain Comments for Calculation View Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    5.6 Replacing Nodes and Data Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    Replace a View Node in Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    Replace a Data Source in Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

    5.7 Using Functions in Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

    String Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    Conversion Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    Mathematical Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    Date Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    Spatial Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

    Spatial Predicates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121

    Miscellaneous Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122

    5.8 Manage Calculation Views with Missing Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

    5.9 Generate Properties File for Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

    5.10 Generate Calculation View Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .