This is an extension to my previous post on Analytic View SAP HANA – How to Create Analytic Views
In this post we will try to look at the Calculated columns and Restricted Columns in Analytic Views.
CALCULATED COLUMN :
Calculated Column in analytic view is of two types 1.Measure 2.Attribute
In this example we gonna create a new calculated column measure called TOTAL_AMOUNT which is calculated by multiplying Order Quantity(from Data Foundation) and Material Unit Price(from Attribute View)
1. Right click on the CALCULATED COLUMNS tree structure under output ( screen shot above)
2. Provide the necessary information in the popup’d window. Name, Data Type,Column Type(here Measure).
In the expression editor drag and drop the fields from the ELEMENTS on which we need to calculate. In this example we are selecting QUANTITY from the output columns list of Data Foundation and UNIT PRICE from the output column list of Attribute View AV_MATERIAL_INFO like below
different Operations and Functions available.
3. Click OK and CHECK and ACTIVATE the analytic view.
4, Now newly create calculated column is available for reporting.
RESTRICTED COLUMN :
Restricted column is used to restrict a measure based on a condition of master data.This feature helps us to push the processing of data set result into HANA rather than to client side.
In this example we gonna created a restricted measure of Net Amount only for product category “Flat Screens”
1. Right Click on Restricted Column in output panel of the analytic view
2. Provide the necessary information like below, Select the restricted measure column here Net Amount and Add Restriction column here Product Category and select the value as “Flat Screens“
3. Click OK and CHECK and ACTIVATE. Go to Data Preview here you can see a new restricted column was added in which the values are displayed for which Product Category = Flat Screens for other it is null( ? ).
In Analysis Tab