Analytical Privileges in SAP HANA: How to Create?

Analytic Privileges restrict the user to view data for which they authorize. SAP HANA Analytic Privileges is used for Security purpose.

SQL Privileges provide authorization on object level not at a record level, so provide a record or row-level authorization “Analytic Privileges” will be used.

SAP HANA Analytic Privileges are used to provide authorization on below information view –

Now we are going to create an Analytic Privileges and will assign to user “ABHI_TEST”, by this Analytic we restrict the user to view data only for a company with value 1000.

How to create analytic privilege in SAP HANA?

Step 1) Go To Analytic Privileges.
Modelling package (Right Click) –> New -> Analytic Privileges.

Create Analytic Privilege

Step 2) The New popup appear, Enter Analytic Privileges.

  1. Enter Analytic Privileges Name / Label.
  2. Package name is automatically selected.
  3. Selection option creates new.

Create Analytic Privilege

In next step Analytic Privileges editor will be displayed for add and edit privileges.

Step 3) Click on ‘OK’ button
Analytic Privileges editor will open as below-

  1. In General Section name and Label is displayed.
  2. Click on “Add Button” in Reference Models Section.
  3. Select Calculation View (CA_FI_LEDGER) which we created earlier.

    Create Analytic Privilege

  4. Click on Add Button for create validity of privileges.
  5. Assign Privileges validity.
  6. Click on Add button for selecting attribute for assign restriction.
  7. Select Attribute Company.
  8. Click on the add button to assign a value to attribute for restriction.
  9. Assign Value by selecting Type / operator and value. Here we want to restrict to user see data of calculation view for the only company (1000).

Create Analytic Privilege

Validate and Activate Analytic Privileges, an analytic privilege is created in Analytic Privileges folder under Modelling package as below –

Create Analytic Privilege

Step 4) Assign Analytic Privileges to User “ABHI_TEST”.
“ABHI_TEST” user have privileges to access modelling package. Double click on User “ABHI_TEST” from Security -> Users.

  1. Select Analytic Privileges tab.
  2. Click on “+” Button.
  3. A pop-up for Select Analytic Privileges will be displayed. Enter Name of Analytic Privileges which we have created earlier.
  4. Select Analytic Privileges.
  5. Click on Ok Button.

Create Analytic Privilege

Analytic Privileges is added as below –

Create Analytic Privilege

Step 5) Deploy this changes in user by clicking deploy button.
A message is displayed as User ‘ABHI_TEST’ changed.

Create Analytic Privilege

Step-6) Check Analytic Privileges.
Check Assign to user “ABHI_TEST” is working or not and Login to “ABHI_TEST” user by select HANAUSER system as below –

  1. Select HDB (HANAUSER) Current System and right click.
  2. Select “Add System with Different User”, and enter User Name/ password for user “ABHI_TEST”.
  3. A System HDB (ABHI_TEST”) will be added to system list.

Create Analytic Privilege

ABHI_TEST user has no full access of data of Calculation view created by HANAUSER, as HANAUSER has created analytic privileges for restriction on this calculation view for the company -1000 and assign to ABHI_TEST user.

So, Go to Content Folder -> Select Package -> Calculation View (CA_FI_LEDGER) ->Right Click -> Data Preview.

Data Preview screen will be displayed as below-

Data in calculation view will be restricted for company code– 1000.

Create Analytic Privilege