Analytical Privileges in SAP HANA

Ratings:
(4.2)
Views:1937
Banner-Img
  • Share this blog:

SAP HANA Analytical Privileges

You apply  SAP HANA analytical privileges when users act as values with certain combinations or dimension attributes

You can use analytic privileges to partition data among various users sharing the same data foundation

You can assign analytic privileges in two ways 

Privileges for selected content models

To define restrictions for a selected group of models.

For example You have defined restrictions on an attribute  CUSL ID that belongs to the CUSTOMER attribute view

The restriction applies to all the selected content models that use this attribute view.

Privileges for All Content Models

To define restrictions for all content models across multiple packages that are specific to a user

For example - You have defined a restriction on an attribute view customer that belongs to the Sales package and the user EMP

The restriction is applicable to all content models across multiple packages that use customers and that are specie to EMP.

Procedure:

Create Package

Right-click on the package and create a new analytical privilege

Enter name

Select required information models

Finish

If you want to restrictors for all content models, sdut the ‘applicable to all content models’ checkbox

In Associated attribute restriction pave

Click on add

       ↓ 

Select the Required Attributes that you

       

Want to apply restrictions

In Assign Restriction Pave

Click on Add

Select Operator (=, ≠, >=, etc)

You can choose values

Act orate

Inclined to build a profession as SAP HANA Developer? Then here is the blog post on, explore "SAP HANA Training"

 

Procedures

By default, the system will create procedures for a script-based calendared view.

Even we can create a customized procedure

Create a package

Select package & Finish

In functional pave write a script for the function using data types.

  • Table / Scalar data type for input parameter
  • Activate

Create attribute view on a single table

Create a package, provide the name

Language (Login language & Dur package language must be the same)

Create a new attribute view

Provide name

Select the type of attribute

1) Standard attribute ------------------ new attribute

2) Time-based attribute ---------------- We can create an attribute on “m-time – dimension” which is available “—sys—bio” catalog

3) Copy-------------- It takes the copy of the already existing view

(We can change the structure of the view)

4) Derived --------- It takes the copy of the already existing view

(We cannot change the structure of the view)

  • Select standard type
  • Select the requested table (ARTICLE COLOUR LOOKUP)

Will get DATA FOUNDATION, Save and output pave

In Data Foundation will get our selected table

Select co because from the table right-click on them select add as an attribute

Will get those attributes under attributes folders in out opt pare

Select a key attribute and make it a key attribute

We have calculated attributes to create a custom calculated attribute to perform calculations on attributes that are available in attribute Forde

So that we took article id as a key attribute

Category and sales price, family attributes under attribute folder

Create calculated attribute by right click on calculated attributes select new

Provide name, description

In key (tab) provide data type, length in expression pave provide required expression example left string (Category, 2)

And ok

In hierarchy pave click a crucible we

We can create two types of hierarchy

Level Based hierarchy

Here we can build a hierarchy in level lose on an object on which are available in the attribute folder

Parent-child hierarchy

Here we can build a hierarchy for a key attribute in the attribute folder here we can provide a part for the key attribute

Scenario: Attribute table on multiple tables

Create a new attribute view

Select two tables (article – lookup, article – color – lookup, join two tables with inner joins or outer joins

From the above procedure need to select attributes to make are of them as a key attribute

Based on our requirement create a new calculated attribute to perform calculations on attributes which are available in the attribute folder

Create Hierarchies

Validate view

Activate view

Create an analytical view of single/multiple tables

Create Package

Create Analytical view

Select the required tables

Note:  We must have at least a fact table

Well get a table in the data foundation to pave

If you select multiple tables, we need to join them with inner join / left outer join / right outer join / referential join/text join and provide cardinalities.

In output pave select private attributes & measure some tables in the DATA FOUNDATION pane

We can create custom calculated attributes to perform calculations attributes which are available in private attributes, attributes views

Create custom calculated measures to perform calculations measures which are available in measures folders and here we have other tab currency tab for measures to provide currency/measure / (attributes)

If you don’t have attributes for currency/measure selecting “simple” is recommended

Create a custom restricted measure by providing aggregation type and measure (available in measure folder)

Click an add restriction

Select parameter (attribute)

Select operator (=, >, <, ≥,≤, is null is not null)

Select values

There we can include values by selecting include a click on

If you want to exclude values deselect check values

Create a custom variable to pass parameters dynamically at the report level

Creating a variable provides the data type of attribute, length of attribute and type of attribute, and selection type

(Single / interval/range)

Validate & activate

Create an analytic view of tables & views

Create a new analytic view

Select the required tables and attribute view

Follow the above steps

Go to logic view will get the DATA foundation table which contains objects which are available in the output to pare

Join data foundation with attribute views

Our selected attributes all appear in attribute view folds in the output pare

Note:- We must join all attribute views with the DATA FOUNDATION table

Validate & activate

Create a Calculated view (Graphical type)

Create a package

Create view calculated view

Select view type is graphical

Select the required tables and select calculated view / Analytic views and attribute views

Join them with them in UNION, PROJECTION & UNION & JOIN

In the UNION component map source fields and target fields and we will get output columns in output objects (classify them as attributes & measures)

For join, join two tables & select the required columns from the tables

They will be available in the output structure and close them as attributes & measures

In projection, we can take columns for output and clarify them as attributes & measures.

Create a script-based Calculated view

Create a package

Create a new calculated view

Select view type is SQL Script

Will get three screens in 1st screen, delegate script and output component

In the script, the component will write a script

The system provides three technical words

1)  Began / End      Untitled  Will write script between beginning and end

2)  VAR-OUT         Untitled  Result of the Script

So VAR-OUT is the same as the output of

Script – view

Screenshot_45

Write a script, based on script output components we need to create output parameters

Provide name, name of the column, data type, lunge, and scale

OK & Activate

Examples for script

SQLA – VIEW – CE – OLAP – VIEW

(“—SYS—BIC”. “EIM360-SHARED/CEAS”,

[“MATNR”,

“PERIO”,

“VKORG”

“Net revenue”]);

Var—out = CE – PROJECTION

(: SQLA-VIEW,

[“MATNR”

“PERIO”

“VKORG”

“Net revenue” As “NETREV”]);

Script 2
/*Actual*/

SQLA – VIEW = CE – CVAP – VIEW

(“-SYC-BIC” . “eim360 – shared / CEAI”,

[“MATNR”,

“PERIO”

“Net Revenue”]);

SQLA = CE_ Projection

( :SQLA-VIEW,

[“MATNR”,

“PERIO”,

“VKORG”,

CE – CALC (‘O’, NVARCHAR (1) ) AS KPLIKZ

“Net Revenue” AS “NETREV”])

/*PLANNED*/

SQLP – VIEW = CE_OLAP_VIEW

(“_SYS_BIC” . “ eim360 – shared / CEPL”

[“MATNR”

“PEABL”

“VKORU”

“Net Revenue”])

SQL_P = CE _ PROJECTION

( : SQLP – VIEW,

[“MATNR”,

“PERBL” AS “PERIO”,

“VKORG”

CE – CALEC ‘1’, NVARCHAR (1) ) AS KPLLK2,

“Net Revenue”  AS “NETREV”]);

/*Union*/

Var-out = CE_UNION _ALL  ( :SQL_A, : SQL _p);

Note All views are stored under the “_SYS_BIC” Catalog which is available for reporting.

For in-depth knowledge of SAP HANA, click on below

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.