April 19, 2012

Attribute View creation in SAP HANA(Using Single and Multiple Tables)


Hello Everyone,

In this document, I am going to explain the steps involved in creating Attribute View in SAP HANA.

We can create Attributes Views....

1) Using single or Multiple Tables

2) Using existing attribute view to enhance your current one ( you want to show material description for each material number).

1) Using Single or Multiple Tables:

The below diagram shows the major steps involved in creating Attribute View.

Attribute view.png

The pre-requisites to create Attribute View are..

i) Tables should exist with data

ii) Package should exist.

In my earlier posts I have shown how to create tables and package.

1) Different ways to create tables and package in SAP HANA system.

Now we will discuss the steps involved in creating Attribute View.

Step1: Right click on your Package -->New -->Attribute View.


Step2: Give the technical name, description and type of attribute view.


We can create Two types Attribute Views.

i) Standard

ii) Time

If we are creating Time type Attribute View then we have to mention which type of time data system has to use (Gregorian/Fiscal). We are not going to discuss this here.

We have below options also while creating Attribute Views

i) Copy from: If you want to use already existing attribute view s template then go for this(you can modification if required for current one).

ii) Derived: This is kind of reference type. You cannot do modifications to the current one (Do the changes for main one).

click on next to proceed further.

Step3: In the next screen, we have to select the tables on which we are going to build Attribute View.

for this example I am using 'CUST_INFO' and 'SALES_EMPLY' tables. Here we can select single or multiple tables (using control key), however I am going to select one table here and I will show how to add tables later.

Drill down appropriate schema, select the tables and click on 'add' to move to right side.


Click on 'Finish' to go to the Modeler Screen.

Step4:

Define Key Attributes: These are used as the keys when we join this Attribute with another Attribute or Analytic View. Right click any attribute --> Add as Key Attribute.


Define Attribute: We have to explicitly define the attributes which are all we need in output. Right click on Attribute --> Add as Attribute.

In this example I have taken 'Customer_Number' as key attribute, 'Customer_name' and 'Customer_Location' as attributes.

We can see the output structure in Right side.


Step4: Now I want to populate the sales employee information for each customer in same Attribute View?

I have created table 'Sales_Emply' but how to add this table to this view.

Using the 'Plus' in the same screen(right top), we can add the table to this existing attribute view.


Now click on 'Add table' and search for the table with name and click on Ok.


Note: Disadvantage with this is we can not add more than one table at a time.

Step6: Define the joining condition between this two tables. Here I have joined Customer Number from both the tables.


The different types of Joins available in SAP HANA are.

i) Referential

ii) Inner

iii) Left Outer

iv) Right Outer

v) Text Join

Step7: Creating Hierarchies is optional while creating Attribute Views. In SAP HANA we can create two types of Hierarchies.

1) Level Based -- This is one to one mapping(one attribute one hierarchy)

2) Parent-Child -- This is one to many(one attribute can have multiple hierarchy levels)

Step8: We have to save the attribute view and then activate it. Only activated views will be available for reporting clients and data preview as well.

We can identify the difference between saved or saved and activated with rhombus' symbol. Only saved views will have rhombus' symbol.

After Save and Before Activation:


After Activation:


Once the view is activated system will create 'column view' for each view and this will be stored in '_SYS_BIC_ schema.The naming convention of the column view will be as follows.

<Package Name>/<View Name>

Step9: The  of the beauty of SAP HANA is 'Data Preview' feature.Once the view creation was done, we can directly analyze the data in view in different perspectives.

The 3 options available in Data Preview are

i) Raw Data

ii) Distinct Values

iii) Values.


Hope this document helps.. 

4 comments:

  1. Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u.
    SAP HANA

    ReplyDelete
  2. Hi Kiruthi,

    Thank you for your comment. I have created my own website... www.sapanalyticsguru.com

    For further update..you can visit this website.

    Regards,
    Venkatesh

    ReplyDelete
  3. This post has a lot of importance to the people…I hope you can continue to inspire and post more of this…Thanks

    ReplyDelete
  4. Thank you so much... i didnt have the knowledge in this now i get an idea about this.. thks a lot






    SAP HANA

    ReplyDelete