SAP-HANA
SAP HANA SQL: Learn in 10 Minutes
Most RDBMS database uses SQL as database language, the reason of being popular is – it is...
Attribute view acts like a dimension. It join multiple tables and act as Master. Attribute view is reusable objects.
Attribute view has the following advantage-
Attribute View are 3 types-
Attribute View Type> | Description |
Standard | It is a standard attribute which is created by table fields. |
Time | It is Time attribute view, which is based on default time table – For calendar type Gregorian -
|
Derived | It is an attribute view which is derived from another existing attribute view. Derived attribute view will be opened in read-only mode. The only editable field is its description. Copy From – When you want to define an attribute view, by copying an existing attribute View, then you can use "Copy From" option. |
Note: Difference between Derived and Copy from is, in the case of derived, you can only edit the description of new attribute view while in the case of copy, you can modify everything entirely.
Standard view creation has pre-define step as below-
Table Creation for Attribute View
Here we are going to create Standard Attribute View for product table, so firstly we create "PRODUCT" and "PRODUCT_DESC" Table.
SQL Script is shown as below for table creation –
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');
Now table "PRODUCT" and "PRODUCT_DESC" is created in schema "DHK_SCHEMA".
Attribute View Creation
STEP 1) in this step,
STEP 2) Now in next window,
STEP 3) Information view editor screen will open. Detail of each part in Information Editor is as below -
STEP 4) To include database table for creating attribute view, click on data foundation node and follow the instruction step by step as below -
Join "PRODUCT" table to "PRODUCT_DESC" by "PRODUCT_ID" field.
STEP 5) Select Join path and Right Click on It and choose Edit option. A screen for Edit Join Condition will appear
After selecting join type click on "OK" button. In next step, we select the column and define a key for output.
STEP 6) In this step, we will select column and define the key for output
Job Log for validation and activation activity is displayed on bottom of screen on the same page, i.e. Job Log section as below -
STEP 7) An attribute view with name "AT_PRODUCT" will be created. To view, refresh the Attribute View folder.
STEP 8) To view data in Attribute view,
STEP 9) To see View Attribute data in data Preview editor –
There are 3 options – Analysis, Distinct and Raw data
Analysis: This is a Graphical representation of the attribute view.
Distinct Values: The distinct value of the column can be displayed here. This will show total no. records for selected attribute.
Raw Data tab: This option display data of attribute view in table format.
STEP 10) View Attribute data in from SQL editor as below –
This option display data through SQL Query from the column view under "SYS_BIC" schema. A column view with name "will created after activation of attribute view "AT_PRODUCT". This is used to see SQL query used for displaying data from the view.
Attribute View when activated, a column view under _SYS_BIC schema is created. So, when we run Data Preview, system select data from column view under a _SYS_BIC schema.
Screen shot of column view "AT_PRODUCT" under "_SYS_BIC" Schema of catalog node is as below -
Most RDBMS database uses SQL as database language, the reason of being popular is – it is...
What is SAP HANA Modeling? SAP HANA Modelling is an activity by which we create information view....
SAP HANA Operator can be used for calculation, value comparison or to assign value. SAP HANA...
In this tutorial, we will learn, 1) SAP HANA Data Type 2) SAP HANA Identifiers SAP HANA Data Type...
What is Sequence? A sequence is a database object that automatically generates the incremented list of...
SAP HANA Provides following SAP HANA Functions- Data Type Conversion Function – Data Type...