HANA Input Parameters with Multi-Values to Filter Calculation Views



Similar documents
SAP BW on HANA & HANA Smart Data Access Setup

SAP BusinessObjects Business Intelligence 4 Innovation and Implementation

SAP Landscape Transformation (SLT) Replication Server User Guide

Memory Management simplifications in ABAP Kernel 7.4*

How-to guide: Monitoring of standalone Hosts. This guide explains how you can enable monitoring for standalone hosts in SAP Solution Manager

Consumption of OData Services of Open Items Analytics Dashboard using SAP Predictive Analysis

Open Items Analytics Dashboard System Configuration

Set Up Hortonworks Hadoop with SQL Anywhere

SAP PartnerEdge Program: Opportunities for SAP-Authorized Resellers

How to Implement a SAP HANA Database Procedure and consume it from an ABAP Program Step-by-Step Tutorial

Using SAP Crystal Reports with SAP Sybase SQL Anywhere

Agentry and SMP Metadata Performance Testing Guidelines for executing performance testing with Agentry and SAP Mobile Platform Metadata based

Sybase ASE Linux Installation Guide Installation and getting started guide for SAP Sybase ASE on Linux

SAP Sybase Adaptive Server Enterprise Shrinking a Database for Storage Optimization 2013

Extend the SAP FIORI app HCM Timesheet Approval

LVS Troubleshooting Common issues and solutions

Information Design Tool User Guide SAP BusinessObjects Business Intelligence platform 4.0 Feature Pack 3

Create and run apps on HANA Cloud in SAP Web IDE

Creating a Fiori Starter Application for sales order tracking

How to Extend a Fiori Application: Purchase Order Approval

Configuring Java IDoc Adapter (IDoc_AAE) in Process Integration. : SAP Labs India Pvt.Ltd

LHI Leasing Simplifying and Automating the IT Landscape with SAP Software. SAP Customer Success Story Financial Services Provider LHI Leasing

How To... Master Data Governance for Material: Create Custom Print forms. Applicable Releases: MDG 7

What's New in SAP BusinessObjects XI 3.1 Service Pack 5

SAP BusinessObjects Dashboarding Strategy and Statement of Direction

Nine Reasons Why SAP Rapid Deployment Solutions Can Make Your Life Easier Get Where You Want to Be, One Step at a Time

How To... Master Data Governance for Material: Maintenance for multiple Materials in one Change Request. Applicable Releases: all

SAP Solution Manager - Content Transfer This document provides information on architectural and design questions, such as which SAP Solution Manager

SAP CRM Service Manager 3.1 Mobile App Extended Feature List An extended list of all the features included in the default delivery of the SAP CRM

Active Quality Management

Setting up Single Sign-On (SSO) with SAP HANA and SAP BusinessObjects XI 4.0

Design Thinking for. Requirements Analysis

SAP Security Recommendations December Secure Software Development at SAP Embedding Security in the Product Innovation Lifecycle Version 1.

Installing and Configuring the HANA Cloud Connector for On-premise OData Access

BW Source System: Troubleshooting Guide

SAP Thought Leadership Paper Engineering, Construction, and Operations. Beyond Enterprise Resource Planning Construction in the ipad Age

TM111. ERP Integration for Order Management (Shipper Specific) COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

SAP BUSINESS PLANNING AND CONSOLIDATION 10.0, VERSION FOR SAP NETWEAVER, POWERED BY SAP HANA STARTER KIT FOR USGAAP

SAP HANA. SAP HANA Performance Efficient Speed and Scale-Out for Real-Time Business Intelligence

Data Governance. Data Governance, Data Architecture, and Metadata Essentials Enabling Data Reuse Across the Enterprise

Compare & Adjust How to Guide for Compare & Adjust in SAP Solution Manager Application Lifecycle Management

Setting up Single Sign-On (SSO) with SAP HANA and SAP BusinessObjects XI 4.0

Streamlined Planning and Consolidation for Finance Teams in Any Organization

Implementing an Enterprise Information Management Strategy An Approach That Mitigates Risk and Drives Down Costs

Using Database Performance Warehouse to Monitor Microsoft SQL Server Report Content

SAP White Paper Enterprise Information Management

Certification Guide Network Connectivity for SAP on Premise and Cloud Solutions Integration

Training.sap.com User Guide

How To Install The Sap Business Explorer 7.X 2.X (Sap) On A Windows 7.30 Computer (Windows 7)

Cloud Single Sign-On and On-Premise Identity Federation with SAP NetWeaver Cloud White Paper

Five Strategies Small and Medium Enterprises Can Use to Successfully Implement High Value Business Mobility

Information Design Tool User Guide SAP BusinessObjects Business Intelligence platform 4.0 Support Package 5

HR400 SAP ERP HCM Payroll Configuration

SAP BusinessObjects Edge BI, Standard Package Preferred Business Intelligence Choice for Growing Companies

BW362. SAP BW powered by SAP HANA COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

SAPFIN. Overview of SAP ERP Financials COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

How to... Master Data Governance for Material: Use the Data Import Framework for Material. Applicable Releases: EhP6, MDG 6.1, MDG 7.

Crystal Reports Server Embedded 2008 with Service Pack 7 for Windows Supported Platforms

Sample Universe on Microsoft OLAP Cube

SAP Business One OnDemand. SAP Business One OnDemand Solution Overview

AC200. Basics of Customizing for Financial Accounting: General Ledger, Accounts Receivable, Accounts Payable COURSE OUTLINE

Guide to the SAP Extended Business Program

Using SAP HANA Variables and Parameters in SAP BusinessObjects BI4.0

Meeting the Challenges of

SAP BusinessObjects Enterprise Software Inventory Tool User's Guide

ForFarmers: SAP Business Communications Management for Call Center Workload Distribution

Additional Guide to Implementing the SAP CRM Service Management rapiddeployment

SAP PartnerEdge Program Guide for Language Services Partners

Questions and Answers: SAP BusinessObjects BI 4.0 and the New Semantic Layer for OLAP

Backup Strategy for Oracle

SAP BusinessObjects Business Intelligence 4.1 One Strategy for Enterprise BI. May 2013

Ignite Your Creative Ideas with Fast and Engaging Data Discovery

Reducing Operational Risk with SAP Management of Change

SAP BusinessObjects SOLUTIONS FOR ORACLE ENVIRONMENTS

SAP BusinessObjects Query as a Web Service Designer SAP BusinessObjects Business Intelligence platform 4.0

SAP BusinessObjects Design Studio Document Version: What's New Guide: SAP BusinessObjects Design Studio

SAP BusinessObjects BI Clients

Business Requirements... 3 Analytics... 3 Typical Use Cases... 8 Related Content... 9 Copyright... 10

Maintaining Different Addresses and Ids for a Business Partner via CRM Web UI

Questions and Answers: SAP BusinessObjects BI 4.0 and the Semantic Layer for SAP Netweaver BW

How To Use Sap Business Objects For Microsoft (For Microsoft) For Microsoft (For Pax) For Pax (For Sap) For Spera) For A Business Intelligence (Bio) Solution

Fiori Frequently Asked Technical Questions

SAP Thought Leadership SAP Customer Relationship Management. Strengthen the Brand and Improve

Xcelsius Dashboards on SAP NetWaver BW Implementation Best Practices

H2G Install SAP Web IDE locally for trial (Mac version)

K in Identify the differences between the universe design tool and the information design tool

Made to Fit Your Needs. SAP Solution Overview SAP Solutions for Small Businesses and Midsize Companies

SAP Work Manager 6.0 Mobile App Extended Feature List

SAP BusinessObjects Cloud

SAP HANA Live & SAP BW Data Integration A Case Study

Within Budget and on Time

Create Mobile, Compelling Dashboards with Trusted Business Warehouse Data

Sending Additional Files from SAP Netweaver PI to third Party System

SAP Operational Process Intelligence Security Guide

SAP Master Data Governance- Hiding fields in the change request User Interface

Optimized Shift Planning and Scheduling Creating Shifts and Aligning Resources to Match the Forecasted Workload

Using Functions, Formulas and Calculations in SAP BusinessObjects Web Intelligence

Variable Exit in Sap BI How to Start

Transcription:

HANA Input Parameters with Multi-Values to Filter Calculation Views Applies to: SAP BusinessObjects BI platform 4.0. Summary This document provides information and guidelines about HANA calculation views with input parameters and its consumption in relational universes. Input parameters are used to filter the calculation view beforehand: users can dynamically select one or more values. Author: Didier Mazoué Company: SAP Created on: May 27, 2013 Author Bio Didier Mazoué is an expert product manager in the semantic layer team at SAP Business Objects Enterprise Information Management. Didier is the expert on most major OLAP databases, SAP NetWeaver BW, HANA, and relational databases. Before joining the product group in 2005, Didier was a strategic presales field representative specializing in closing large database deals. He currently resides in France and works out of the SAP Lab in Levallois-Perret. 2013 SAP AG 1

Table of Contents Applies to:... 1 Summary... 1 Authors Bio... 1 Audience... 3 Purpose... 3 Requirements... 3 Calculation view definition... 3 Universe... 5 Parameter definition... 5 First solution... 6 Second solution... 7 List of values definition... 8 First solution... 8 Second solution... 9 Derived table definition... 9 First solution... 9 Second solution... 10 Preview calculation view data... 11 First solution... 12 Second solution... 16 2013 SAP AG 2

Audience This document is intended for HANA designers and universe designers who have a working knowledge of building HANA views using HANA Studio and universes using the Information Design Tool. Purpose The document is based on several customers requirements asking for filtering a calculation view beforehand. The customers requirements are: select one or multiple values from an attribute with the ability to manually enter values. This document presents hint and tips for creating a relational universe (data foundation), to support HANA input parameters with multiple values. The document also focuses on the calculation view creation. Requirements As described in the document purpose, the main requirement is to filter the calculation views before creating it. In HANA Studio the only way to do it is to create a calculation view using SQL script to filter the data. The only way for filtering a calculation view is to create an input parameter but unfortunately input parameters only accept single value. The requirement is to let the uses select one or multiple values from an attribute list of values, potentially manually enter values and also do a search on the database. The latter is motivated by the size of the list of values: some of the attributes contain hundreds of thousands distinct values. Calculation view definition Because input parameters only support one value, the values selected by the user must not be enclosed with quotes like this: Value 1, Value 2, Value 3. It means that the SQL expression must be able to analyze the content of the input parameter in order to filter the data. The solution is to use the SQL function LOCATE. Definition: Returns the position of a substring needle within a string haystack. Returns 0 if needle is not found within haystack. Returns NULL if haystack or needle is NULL, or if haystack is an empty string. As the user can select one or multiple values each value is separated by a comma and enclosed with parenthesis like this. (Value 1,Value 2,Value 3). Finally the input parameter value is always enclosed by single-quotes and will look like this: (Value 1,Value 2,Value 3). So the SQL WHERE clause the calculation view needs to analyze the input parameter content to detect if a selected value is one of the attribute values. Here is a calculation view script based on the Foodmart schema where the input parameter is based on the attribute PRODUCT_CATEGORY from the attribute view PRODUCT.. 2013 SAP AG 3

Calculation view definition SELECT "COUNTRY" AS "CUSTOMER_COUNTRY", "STATE" AS "CUSTOMER_STATE", "CITY" AS "CUSTOMER_CITY", "FAMILY" AS "PRODUCT_FAMILY", "DEPARTMENT" AS "PRODUCT_DEPARTMENT", "CATEGORY" AS "PRODUCT_CATEGORY", "SUBCATEG" AS "PRODUCT_SUBCATEGORY", "PRODUCT" AS "PRODUCT", "STORE_COUNTRY" AS "STORE_COUNTRY", "STORE_STATE" AS "STORE_STATE", "STORE_CITY" AS "STORE_CITY", "TYPE" AS "STORE_TYPE", "STORE" AS "STORE", "YEAR" AS "YEAR", "QUARTER" AS "QUARTER", "MONTH" AS "MONTH", SUM("STORE_SALES") AS "STORE_SALES", SUM("STORE_COST") AS "STORE_COST", SUM("UNIT_SALES") AS "UNIT_SALES" FROM "_SYS_BIC"."foodmart/SALES_2007" GROUP BY "COUNTRY", "STATE", "CITY", "FAMILY", "DEPARTMENT", "CATEGORY", "SUBCATEG", "PRODUCT", "STORE_COUNTRY", "STORE_STATE", "STORE_CITY", "TYPE", "STORE", "YEAR", 2013 SAP AG 4

"QUARTER", "MONTH" WHERE : CATEGORY = '(*)' OR ( (locate( :CATEGORY, ',' "PRODUCT_CATEGORY" ',')!= 0) OR (locate( :CATEGORY, ',' "PRODUCT_CATEGORY" ')')!= 0) OR (locate( :CATEGORY, '(' "PRODUCT_CATEGORY" ',')!= 0) OR (locate( :CATEGORY, '(' "PRODUCT_CATEGORY" ')')!= 0) ); The SQL WHERE clause analyzes all possible user answers including * if the user select all values. Universe The universe designer needs to use Information Design Tool to create the universe. The first action is to create a relational connection on the HANA server then create a data foundation on top of the new created connection. Then drag and drop the calculation view (in SYS_BIC_ schema) in the data foundation. To support the calculation view, the data foundation needs to be enriched with the addition of: a derived table a parameter a list of values Parameter definition A parameter needs to be created in the data foundation. Parameters can be created and edited in the PARAMETERS AND LIST OF VALUES pane of the data foundation editor. 2013 SAP AG 5

First solution If the requirement is to let the users entering search criteria to filter the database before displaying the list of values, a parameter must be created as following: The parameter options are the following: Not based on a list of values: manual entry Single value Default value = * Setting * as default value do not force the user to enter a value when prompted. It allows running the query without filtering the calculation view. 2013 SAP AG 6

Second solution If the requirement is to let the users manually enter the categories (full name and not search criteria) to filter the database before displaying the list of values, a parameter must be created as following: The parameter options are the following: Not based on a list of values: manual entry Multiple values Default value = * Setting * as default value do not force the user to enter a value when prompted. It allows running the query without filtering the calculation view. 2013 SAP AG 7

List of values definition A list of values needs to be created in the data foundation. List of values can be created and edited in the PARAMETERS AND LIST OF VALUES pane of the data foundation editor. For performance reasons, it is important to build the SQL on top of the dimension table or the attribute view contain the product values. Defining a list of values on an analytic view or a calculation view can manipulate too much data. First solution If the requirement is to let the users entering search criteria to filter the database before displaying the list of values, the list of values must be a SQL list of values and references the parameter defined in the first solution of parameters definition: List of values definition SELECT '*' AS PRODUCT_CATEGORY FROM SYS.DUMMY UNION SELECT @Prompt(Search categories) AS PRODUCT_CATEGORY FROM SYS.DUMMY UNION SELECT DISTINCT "PRODUCT_CATEGORY" FROM "FOODMART"."PRODUCT_CLASS" WHERE "PRODUCT_CATEGORY" LIKE CASE WHEN @Prompt(Search categories) = '*' THEN '*************' ELSE '%' @Prompt(Search categories) '%' END ORDER BY 1 As you can see the list of values will return: Always a * for allowing users to select it as the placeholder for All values. The value entered by the user if the value is a category and not a search criteria The categories filtered by the search criteria using the LIKE SQL function. This is another reason to use the dimension table or the attribute view. You can notice that if the user has enter * as search criteria it is replaced by something that will return no value. This construction is dependent of the size of the list of values: If the list of values is very large, the customers don t want that all values are displayed in the list for performance reason If the list of values is small, then all values can be displayed in the list and we can replace the SQL expression WHEN @Prompt(Search categories) = '*' THEN '*************' by WHEN @Prompt(Search categories) = '*' THEN '%': all values will be retrieved from the dimension. 2013 SAP AG 8

Second solution If the requirement is to let the users manually enter the categories (full name and not search criteria) to filter the database before displaying the list of values, the list of values must be a SQL list of values and references the parameter defined in the second solution of parameters definition: List of values definition SELECT '*' AS PRODUCT_CATEGORY FROM SYS.DUMMY UNION SELECT DISTINCT "PRODUCT_CATEGORY" FROM "FOODMART"."PRODUCT_CLASS" WHERE "PRODUCT_CATEGORY" IN @Prompt(Enter categories) ORDER BY 1 As you can see the list of values will return: Always a * for allowing users to select it as the placeholder for All values. The categories filtered by the user selection. Derived table definition Once the parameter and the list of values have been defined, we need now to create the derived table in order to use prompt the user to select values from the list of values and add the results in the input parameter placeholder. First solution If the requirement is to let the users entering search criteria to filter the database before displaying the list of values, the data foundation must contain an @prompt based on the first list of values definition: Derived table definition SELECT "CUSTOMER_COUNTRY", "CUSTOMER_STATE", "CUSTOMER_CITY", "PRODUCT_FAMILY", "PRODUCT_DEPARTMENT", "PRODUCT_CATEGORY", "PRODUCT_SUBCATEGORY", "PRODUCT", "STORE_COUNTRY", "STORE_STATE", "STORE_CITY", "STORE_TYPE", "STORE", "YEAR", "QUARTER", "MONTH", SUM("STORE_SALES") as STORE_SALES, SUM("STORE_COST") as STORE_COST, SUM("UNIT_SALES") as UNIT_SALES FROM "_SYS_BIC"."foodmart/CALC_SALES_FILTER_BEFORE_LOCATE" ('PLACEHOLDER' = ('$$category$$', '@Prompt('Select categories','k',first solution',multi,constrained,persistent,{'*'})')) GROUP BY "CUSTOMER_COUNTRY", "CUSTOMER_STATE", 2013 SAP AG 9

"CUSTOMER_CITY", "PRODUCT_FAMILY", "PRODUCT_DEPARTMENT", "PRODUCT_CATEGORY", "PRODUCT_SUBCATEGORY", "PRODUCT", "STORE_COUNTRY", "STORE_STATE", "STORE_CITY", "STORE_TYPE", "STORE", "YEAR", "QUARTER", "MONTH" The derived table contains a prompt based on the list of values named first solution. The prompt data type is K : it means that the values selected by the user are not enclosed by single quotes. The prompt allow the user to select multiple values but only in the list (parameter constrained). This is a restriction of K data type to avoid SQL injection. A default value (*) is added in the prompt definition: this allows the validation of the derived table because prompt needs to be solved beforehand. The prompt expression is enclosed by single-quotes to ensure that HANA will validate the derived table SQL expression. Second solution If the requirement is to let the users manually enter the categories (full name and not search criteria) to filter the database before displaying the list of values, the data foundation must contain an @prompt based on the second list of values definition: Derived table definition SELECT "CUSTOMER_COUNTRY", "CUSTOMER_STATE", "CUSTOMER_CITY", "PRODUCT_FAMILY", "PRODUCT_DEPARTMENT", "PRODUCT_CATEGORY", "PRODUCT_SUBCATEGORY", "PRODUCT", "STORE_COUNTRY", "STORE_STATE", "STORE_CITY", "STORE_TYPE", "STORE", "YEAR", "QUARTER", "MONTH", SUM("STORE_SALES") as STORE_SALES, SUM("STORE_COST") as STORE_COST, SUM("UNIT_SALES") as UNIT_SALES FROM "_SYS_BIC"."foodmart/CALC_SALES_FILTER_BEFORE_LOCATE" ('PLACEHOLDER' = ('$$category$$', '@Prompt('Select categories','k',second solution',multi,constrained,persistent,{'*'})')) 2013 SAP AG 10

GROUP BY "CUSTOMER_COUNTRY", "CUSTOMER_STATE", "CUSTOMER_CITY", "PRODUCT_FAMILY", "PRODUCT_DEPARTMENT", "PRODUCT_CATEGORY", "PRODUCT_SUBCATEGORY", "PRODUCT", "STORE_COUNTRY", "STORE_STATE", "STORE_CITY", "STORE_TYPE", "STORE", "YEAR", "QUARTER", "MONTH" There is no difference in the derived table SQL expression between the first and second solutions except that the list of values referenced in the prompt are different.. Preview calculation view data For both solutions we have create two prompts: one with the parameter and the second using @prompt expression. We have created a prompt dependency also called cascading prompts: the @prompt defined in the derived table depends on the parameter created in the data foundation and referenced by the list of values. So the user must have to first answer to the parameter and the select values in the list of values referenced by the @prompt expression. 2013 SAP AG 11

First solution 2013 SAP AG 12

2013 SAP AG 13

2013 SAP AG 14

2013 SAP AG 15

Second solution 2013 SAP AG 16

2013 SAP AG 17

2013 SAP AG 18

2013 SAP AG 19

www.sap.com 2013 SAP AG. All rights reserved. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and Adaptive Server, ianywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company. Crossgate, m@gic EDDY, B2B 360, and B2B 360 Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group 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.