Attribute View in SAP HANA: How to Create?

โšก Smart Summary

Attribute views in SAP HANA model master data as a reusable dimension, joining tables such as PRODUCT and PRODUCT_DESC so reports read descriptive text alongside keys, without any measure or aggregation.

  • 🧱 Purpose: An attribute view supplies master-data context, providing text or description for key and non-key fields.
  • ♻️ Reuse: One activated attribute view can be consumed by analytic views and calculation views alike.
  • 🗂️ Types: Standard, Time and Derived, with Copy From as an editable alternative to a read-only derived view.
  • 🛠️ Build: Drop tables on the data foundation, join on PRODUCT_ID, mark the key, validate, then activate.
  • 🔍 Preview: Data preview offers Analysis, Distinct Values and Raw Data tabs, or plain SQL output.
  • 🏛️ Runtime: Activation generates a column view under the _SYS_BIC schema, which every query actually reads.

Attribute view modeling in SAP HANA Studio

What is an Attribute View in SAP HANA?

An attribute view in SAP HANA acts like a dimension. It joins multiple tables, behaves as master data for other views, and is a reusable object.

Attribute views offer these advantages.

  • It acts as the master data context, providing text or a description for key and non-key fields.
  • It can be reused in an analytic view and in a calculation view.
  • It selects a subset of columns and rows from a database table.
  • Attributes (fields) can be calculated from fields of several tables.
  • It holds no measure and no aggregation option.

Attribute View Types

Three attribute view types are available, and the type is chosen in the creation dialog.

Attribute View Type Description
Standard A standard view built from table fields, used in the walkthrough below.
Time Based on the default time tables. Gregorian: M_TIME_DIMENSION, M_TIME_DIMENSION_YEAR, M_TIME_DIMENSION_MONTH, M_TIME_DIMENSION_WEEK. Fiscal: M_FISCAL_CALENDAR.
Derived Derived from an existing attribute view. It opens read-only, and only the description can be edited.

Copy From in the same dialog defines a view by copying an existing one. The difference matters: a derived view allows only its description to be edited, while a copy can be modified entirely.

How to Create an Attribute View in SAP HANA

Standard view creation follows the predefined sequence below, from table creation to data preview.

Predefined steps for standard attribute view creation in SAP HANA

Table Creation for Attribute View

A standard attribute view is built here for a product table, so the “PRODUCT” and “PRODUCT_DESC” tables are created first with the scripts below.

Product table script –

CREATE	 COLUMN TABLE "DHK_SCHEMA"."PRODUCT"
(	
"PRODUCT_ID"	NVARCHAR (10) PRIMARY KEY,								
"SUPPLIER_ID"	NVARCHAR (10),				
"CATEGORY" NVARCHAR (3),				
"PRICE"	 DECIMAL (5,2)
);		

INSERT	INTO "DHK_SCHEMA"."PRODUCT" VALUES ('A0001','10000','A', 500.00);																	
INSERT	INTO "DHK_SCHEMA"."PRODUCT" VALUES ('A0002','10000','B', 300.00);																	
INSERT INTO "DHK_SCHEMA"."PRODUCT" VALUES ('A0003','10000','C', 200.00);																	
INSERT	INTO "DHK_SCHEMA"."PRODUCT" VALUES ('A0004','10000','D', 100.00);																	
INSERT	INTO "DHK_SCHEMA"."PRODUCT" VALUES ('A0005','10000','A', 550.00);

Product description table script –

CREATE COLUMN TABLE "DHK_SCHEMA"."PRODUCT_DESC"									
(	
"PRODUCT_ID" NVARCHAR (10) PRIMARY KEY,								
"PRODUCT_NAME" NVARCHAR (10)				
);

INSERT INTO	"DHK_SCHEMA"."PRODUCT_DESC"	VALUES ('A0001','PRODUCT1');															
INSERT INTO	"DHK_SCHEMA"."PRODUCT_DESC"	VALUES ('A0002','PRODUCT2');															
INSERT INTO	"DHK_SCHEMA"."PRODUCT_DESC"	VALUES ('A0003','PRODUCT3');															
INSERT INTO	"DHK_SCHEMA"."PRODUCT_DESC"	VALUES ('A0004','PRODUCT4');															
INSERT INTO	"DHK_SCHEMA"."PRODUCT_DESC"	VALUES ('A0005','PRODUCT5');

Both tables now exist in schema “DHK_SCHEMA”, so the modeling steps can begin.

Attribute View Creation

Step 1) Select the SAP HANA system, then work down the content node as shown below.

  1. Select the Content folder.
  2. Select the non-structural package MODELLING under DHK_SCHEMA, then right-click and choose New.
  3. Select the Attribute View option.

Right-click New Attribute View on the MODELLING package in SAP HANA Studio

Step 2) Enter the view information in the creation dialog shown below.

  1. Enter the attribute view name and label.
  2. Select the view type, here Attribute View.
  3. Select the subtype “Standard”.
  4. Click the Finish button.

Attribute view creation dialog with name, view type and Standard subtype

Step 3) Check the view editor screen. The information view editor opens, and each numbered part of it is described below.

  1. Scenario pane: contains the Semantics and Data Foundation nodes.
  2. Detail pane: contains the Column, View Properties and Hierarchies tabs.
  3. Semantics node: the output structure of the view, here a dimension.
  4. Data Foundation node: the tables that define the view, dropped here.
  5. The tabs of the detail pane are displayed.
  6. Local: shows every local attribute detail.
  7. Show: filter for local attributes.
  8. Detail of the selected attribute.
  9. Toolbar: performance analysis, find column, validate, activate, data preview.

Information view editor showing scenario pane, detail pane and toolbar

Step 4) Click the Data Foundation node to include database tables, then follow the sequence below.

  1. Drag tables “PRODUCT” and “PRODUCT_DESC” from the TABLE node under DHK_SCHEMA.
  2. Drop “PRODUCT” and “PRODUCT_DESC” on the Data Foundation node.
  3. Select the fields of “PRODUCT” as output; the field icon turns from grey to orange.
  4. Select the fields of “PRODUCT_DESC” as output in the same way.
  5. Output fields from both tables appear in the column list of the output pane.

PRODUCT and PRODUCT_DESC tables dropped on the data foundation node

Join the “PRODUCT” table to “PRODUCT_DESC” on the “PRODUCT_ID” field.

Step 5) Select the join path, right-click it and choose Edit. The Edit Join Condition screen appears.

  1. Select the join type “Inner”.
  2. Select the cardinality “1..1”.

Edit Join Condition screen with inner join type and 1..1 cardinality

Click OK to confirm. Other SAP HANA join types, such as referential and text joins, are set in the same dialog.

Step 6) Select the columns and define the output key.

  1. Select the Semantics node.
  2. The Column tab appears in the detail pane.
  3. Select “PRODUCT_ID” as Key.
  4. Check Hidden for field PRODUCT_ID_1, from PRODUCT_DESC.
  5. Click the Validate button.
  6. After successful validation, click the Activate button.

Semantics column tab with PRODUCT_ID set as key and PRODUCT_ID_1 hidden

The Job Log section at the bottom of the screen reports validation and activation.

Job Log section reporting successful validation and activation

Step 7) The attribute view “AT_PRODUCT” now exists; refresh the Attribute View folder to see it.

  1. Go to the DHK_SCHEMA->MODELLING package.
  2. AT_PRODUCT appears under the Attribute View folder.

AT_PRODUCT listed under the Attribute View folder of the MODELLING package

Step 8) Check the data. Select Data Preview on the toolbar; two options are offered, as shown below.

  • Open in Data Preview Editor, with analysis options.
  • Open in SQL Editor, with only the query output.

Data preview menu offering Data Preview Editor and SQL Editor

Step 9) Check the view data. The preview editor offers three tabs: Analysis, Distinct Values and Raw Data.

Analysis is a graphical representation of the attribute view.

  1. Select attributes for the label and value axes.
  2. An attribute on the label axis appears on the X axis.
  3. An attribute on the value axis appears on the Y axis.
  4. Output is available as chart, table, grid and HTML.

Analysis tab charting attribute view data on label and value axes

Distinct Values lists the distinct values of a column with the record count for the selected attribute.

Distinct Values tab listing distinct entries and record counts

Raw Data displays the attribute view data in table format.

  1. Click the Raw Data tab.
  2. The data appears in table format.

Raw Data tab showing attribute view records in table format

Step 10) Check the data from the SQL editor, chosen in the same preview menu.

Open in SQL Editor option in the data preview menu

This option reads the column view generated in the “_SYS_BIC” schema when “AT_PRODUCT” was activated, so the editor also shows the SQL statement used.

  1. The SQL query used for data selection is displayed.
  2. The output is displayed.

SQL editor showing the generated SELECT statement and its result set

Every data preview therefore reads from _SYS_BIC, not from the design-time object. The screenshot below shows column view “AT_PRODUCT” under that schema in the catalog node.

Column view AT_PRODUCT under the _SYS_BIC schema in the catalog node

One planning note: attribute views are deprecated, so on current releases the same dimension is built as a calculation view of data category Dimension. The steps above still apply to existing content in SAP HANA Studio, and the wider SAP HANA modeling material covers the replacements.

FAQs

A graphical calculation view of data category Dimension. Attribute views are deprecated, cannot be added to new calculation views, and SAP HANA Cloud supports calculation views only, so content is converted before migration.

The time tables start empty. Generate Time Data in the Quick Launch view fills M_TIME_DIMENSION and its year, month and week tables for a chosen range, or M_FISCAL_CALENDAR for a fiscal calendar.

Two, both created on the Hierarchies tab. A level hierarchy fixes ordered levels such as country, region, city. A parent-child hierarchy derives depth from a parent column, which suits cost centres.

The modeler needs package privileges and SELECT on the source schema. _SYS_REPO needs SELECT with grant option there, otherwise activation fails. Consumers need SELECT on _SYS_BIC plus an analytic privilege.

Activation succeeded but the runtime object is unreadable. The user usually lacks SELECT on the generated _SYS_BIC column view, or holds no analytic privilege covering the requested rows.

Yes, provided the modeler and _SYS_REPO hold SELECT on each schema. Cross-schema models usually point at a synonym or a dedicated schema so transports stay portable.

Machine learning matches duplicate master records, proposes missing descriptions and classifies products. Because an attribute view exposes clean keys and texts, it is a convenient input for those models and for predictive services inside the database.

It helps with the code around the view: DDL, test data and CDS or HDI artifacts. Graphical modeling stays manual, and generated SQL still needs checking against the real schema and privileges.

Summarize this post with: