0% found this document useful (0 votes)
146 views

SAP HANA Attribute View

The document discusses how to create an attribute view in SAP HANA in 9 easy steps. It begins by explaining what an attribute view is, which is a set of dimensions that can be joined with a fact table in an analytic view. It then covers the different types of attribute views and how to create one through a 10 step process in SAP HANA Modeler, including selecting tables and fields, defining joins and hierarchies, and previewing the data.

Uploaded by

Sittipat Art
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views

SAP HANA Attribute View

The document discusses how to create an attribute view in SAP HANA in 9 easy steps. It begins by explaining what an attribute view is, which is a set of dimensions that can be joined with a fact table in an analytic view. It then covers the different types of attribute views and how to create one through a 10 step process in SAP HANA Modeler, including selecting tables and fields, defining joins and hierarchies, and previewing the data.

Uploaded by

Sittipat Art
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

SAP HANA Attribute View –

Create Attribute View in 9 Easy


Steps
BY DATAFLAIR TEAM · UPDATED · APRIL 11, 2019
Moving ahead in understating modeling with SAP HANA Information
Modeler, let us start with learning about SAP HANA Attribute View. In this
lesson, we will first understand the concept behind the attribute view, the
process flow of creating the attribute view and types of attribute view. Along
with the conceptual knowledge, we will also learn how to create attribute view
in SAP HANA Modeler.
Let us rewind a little and recall the significance of information modeling in
SAP HANA. Information models or Views are logical frameworks or run-time
objects which structures data from one-dimensional databases into multi-
dimensional data structures for analytical purposes. The information views do
not store data physically in SAP HANA. The logic of a view is stored in HANA
and every time a reporting tool requests the view, the system fetches the data
according to the blueprint of the view from the data source and presents it to
the user.

Let’s start this tutorial by learning the definition of Attribute View.


What is SAP HANA Attribute View?
The Attribute View in SAP HANA is a set of dimensions or master data which
can be joined with the fact table in an Analytic View. An Attribute View can be
created by taking data from one or more data tables. The attribute shows
relationships between different attributes. The attributes can be Customers,
Region, Product, Period etc. In an Attribute View, joins can be made between
two master data tables, a text table, and a master data table, etc.
Types of Attribute View
 Standard Attribute Views: These views create by table fields among
different column store tables by using joins in SAP HANA.
 Derived Attribute Views: It is an Attribute View created using another
existing Attribute View. It will open in read-only mode, we cannot edit the
derived Attribute view. The only editable field in the created Attribute
View is the description. It will act as a reference to the base Attribute view.
Any modification to the base Attribute View will reflect in the created
Attribute View.
 Timed Attribute Views: Timed Attribute View stores the time-dependent
data. It is created against calendar tables – M_FISCAL_CALENDAR (or)
time tables – M_TIME_DIMENSION, M_TIME_DIMENSION_YEAR,
M_TIME_DIMENSION_MONTH and M_TIME_DIMENSION_WEEK.
All these tables stores in _SYS_BI schema.
Learn the concept of SAP HANA Modeling
Types of Joins
Tables from data sources join in different ways to create an Attribute View in
SAP HANA. The join types are:

 Referential Join
 Inner Join
 Left Outer Join
 Right Outer Join
 Text Join
Along with defining the join type of the Attribute View, the cardinality of
tables is also important to specify. The cardinality can be 1:1, 1: N or N:1.

Explore Unique SAP HANA Features


Types of Hierarchies
Along with cardinality, and join type, dimensions in Attribute View arranges
in hierarchies. There are two types of hierarchies in which attributes in a set
gets arrange; Level hierarchy and Parent-Child hierarchy.

 The level hierarchy follows a rigid pattern of root and child nodes where
successive attributes can be accessed only in the order they were created.
 A parent-child hierarchy is like a tree structure where there are multiple
sub-nodes of a root node which can further extend to an undecided length.
Thus, the tree-like structure has unbalanced root nodes.

Creating an Attribute View in SAP


HANA
Before we learn how to create the Attribute View in SAP HANA Modeler, let us
understand the process flow in order to create a complete and proper
Attribute View.

 Enter details: Enter the technical name of the table and mention the
table type.
 Table selection: Select tables from the database schemas. You can select
tables from more than one schema. If you select multiple tables, joins can
create between them in this step.
 Field selection: Define the key column and select the output column.
 Advanced operations: You can carry out transformation processes on
columns like creating calculated columns, creating hierarchies, etc.
 Active and data preview: At last, you can activate the Attribute View after
saving the selections made by you and go to Data Preview to preview the
view created.
Learn the Installation process of SAP HANA
Attribute View Creation
Here are the steps to create an Attribute View in SAP HANA Modeler:

Step 1: Open packages in the Content folder in the SAP HANA Modeler.
Step 2: Then, select an existing package or create a new package from the
Content node.
Right-click on the package name, go to New and select Attribute View option.

Check out Latest SAP HANA Use Cases


Step 3: Enter the technical name of the view carefully, as it cannot be changed
later. Also, you can enter a label name. From the Copy From option, you can
select an existing Attribute View to act as a basis for the new one. Select a
subtype and click on Finish.

Step 4: Then, a view editor will open. The Semantics section shows all the
details that relate to the columns from the tables. And, you can create the
Attribute View in the Data foundation section of SAP HANA Modeler.

Must learn: SAP HANA Studio Overview


Step 5: After that, you can select the table from the schema in two ways. Either
by finding the table under the schema name in Catalogue node and dragging-
dropping the table on the editing pane. You can add tables from more than
one schema and create joins between them.

Or, by clicking on the green plus sign next to the Data foundation section and
searching the table by name.

Step 6: Now, its time to select columns from the table to add into the Attribute
View in SAP HANA Modeler. You can add columns into the view in two ways;
either by right-clicking on the column name and selecting Add to Output. The
column name will show in the right-most Output column and also on the Data
foundation at the left. Or, you can simply click on the dot present in-front of
the column name and it will turn orange indicating that it is added.

Learn to Use SAP HANA Administration Console


Step 7: If you wish to remove a column from the Output, right-click on the
column name and click on Remove.
Step 8: Next, you can go to the Semantics section from where you have to
select at least one column as the key attribute. From the properties section in
SAP HANA Modeler, you can see the properties of the Attribute View. Also,
you can set the Cache Invalidation Period which sets the time of data loading
from the RAM to the cache. The data tables stay into the cache for that defined
period. And, create hierarchies from the Hierarchy section.
Understand the process to Use SAP HANA on Azure
Step 9: Upon completing all the processes of adding columns and tables to
create the Attribute View, save and activate the view by clicking on the green
tick icon and green arrow given on the panel on top. Then go to the Data
preview icon.

Step 10: The data preview window contains three tabs; Analysis, Distinct
values, and Raw data. The raw data section shows the data in tabular form.
Lastly, you can do instant analysis using the data from the columns in the
Analysis tab. Just drag-and-drop the columns in place of two axes and
visualization create.

Check out Top SAP HANA Books to master the technology

Summary
Thus, in this lesson, we learned about the first, which the very basic
information view in SAP HANA, that is, the Attribute View. We went through
the Attribute View as a concept moving forward with learning how to create it
in SAP HANA Modeler. In the lessons to come, we will learn about the other
two views, namely Analytic View and Calculation View.
Therefore, don’t forget to check the upcoming articles. If you have come across
with any kind of queries related to SAP HANA Attribute View article, feel free
to ask in the comment section.

SAP HANA Analytic View – Create


Analytic View in 15 Easy Steps
BY DATAFLAIR TEAM · UPDATED · APRIL 3, 2019
After learning about the Attribute View, let’s move on to understanding the
Analytic View. In this lesson, we will first understand the concept behind the
Analytic View in SAP HANA. Then, we will discuss some characteristics of
Analytic View and at last, we will proceed to learn how to create an Analytic
View in SAP HANA.

What is SAP HANA Analytic View?


The Analytic Views in SAP HANA are one step ahead in terms of complexity as
compared to the Attribute View. The Analytic Views are multi-dimensional
views involving attributes and measures arranged in a star schema fashion. In
the center lies the fact table, which is a table containing measure columns
from the transactional SAP HANA database.
Surrounding this fact table is a different set of attribute tables/views. The
attributes or dimensions attached to the fact table making an analytic view
provides relevance to the measures in the fact table. Thus, a user can examine
data (transactional data) from different perspectives. For instance, you can
have a fact table named Sales linked to four attribute views or dimensions
such as Region, Period, Customer, and Product. That is, sales can be analyzed
with respect to the regions, customers, years, or products. The multi-
dimensional view created in the analytic view is also representative of OLAP
cubes.
Features of SAP HANA Analytic View
Some important features of the analytic view in SAP HANA are:

 Analytic views run start schema queries.


 The measures used in the fact table can be calculated measures or
restricted measure.
 You can perform complex calculations and apply aggregation functions
(sum, min, max, count etc.) on the data used in the Analytic View.
Explore Unique Features of SAP HANA

Steps to Create an Analytic View in SAP


HANA
Here are the steps to create an Analytic View in SAP HANA Modeler:

Step 1: Open SAP HANA Modeler perspective in the SAP HANA Studio.
Step 2: Your pre-existing attribute views will be present within a package in
the Content node.
Step 3: Right-click on the package for which you need to create an Analytic
View in SAP HANA which also contains the attribute views. Click on New and
select Analytic view from the drop-down list.

Step 4: Enter the technical name of the view and add a description. You can set
other properties as well, like view type, subtype etc. Click on Finish.

Check out Latest SAP HANA Use Cases


Step 5: The design view for the analytic view in SAP HANA Modeler
opens. 

From the semantics section, you can access the columns, view properties,
hierarchies and variables or parameters.
Step 6: Now its time to add tables into the Data foundation. You can add the
data tables from the left panel either by dragging and dropping or by searching
the table’s name, Add Objects icon.

Must learn: SAP HANA Installation Guide


Step 7: If you have more than one table selected, then you need to define a join
condition and cardinality. Here, in the image shown below, we have selected
join type as inner join and set cardinality as 1: N in the join created two tables
ORDERS and ORDERDETAILS.
Step 8: Next, we have to select columns for output from both tables by clicking
on the grey dots given in front of each column of the table which will turn
orange as a sign of being added into the output.

Step 9: Now we will go to the “start join” section to link all the attributes views
with the data foundation (fact table). As you can see in the image below, we
have selected three attribute views in the Star Join section; AT_CUSTOMER,
AT_PRODUCTS and AT_TIME.

Three separate tables for the three attribute views will get add in the editor
pane.
Learn to Use SAP HANA Studio Administration Console
Step 10: We will join the fact table with the attribute view table with common
columns, as shown in the image below. We have joined the two tables (fact
table and attribute view) with the column CUSTOMERNUMBER.

Also, we have defined the join type as an outer join.


Step 11: We will join the two other attribute tables with the fact table in the
same way. This will form a star schema like structure of tables.

Step 12: Next, we’ll define measures and dimensions for the table from the
Semantics section. You can tag the measure fields as measures from clicking
on the columns and then on the yellow icon on the bar (indicated by the blue
arrow). And similarly, tag the dimensions by selecting the attribute icon
shown by the red arrow.

Understand the process to Use SAP HANA on Azure 


Step 13: After assigning the measures and dimensions, save the Analytic View
in SAP HANA Modeler by clicking on the green tick and execute the view by
clicking on the green arrow (shown in the red box).
Step 14: After validating and executing it, open the data preview section.
There, the raw data from all the tables of the Analytic View in SAP HANA
Modeler will get load.

Learn the concept of SAP HANA Modeling


Step 15: From the Analysis section, you can quickly analyze the data by
selecting attributes and measures to create different charts and graphs like a
bar graph, Mekko chart, pie chart, scatter chart etc.
Check out the Top SAP HANA Books for gaining expertise in SAP HANA

Summary
We learned about one more Information View in SAP HANA which is the
Analytic View. We hope you are understanding the flow of logic as to why
these information views are created. In the next lesson, we will learn about a
more complex Information View that is Calculation View.
Any doubts or feedbacks regarding the SAP HANA Analytic View article?
Simply enter in the comment section.

SAP HANA Calculation View –


Create Calculation View in 12 Easy
Steps
BY DATAFLAIR TEAM · UPDATED · MAY 17, 2019
In this tutorial, we are going to learn about the last and complex of the three
types of information views; the SAP HANA Calculation View. Please make sure
you have gone through the tutorials of Attribute View and Analytic View as
they are important for your understanding of Calculation View.
Let’s start the SAP HANA Calculation View Tutorial.

What is SAP HANA Calculation View?


Calculation view in SAP HANA is the most important type of information view as it
enables you to perform advanced designing operations on the data. You can apply
advanced modeling logics on data in Calculation View which you cannot do in
Analytic and Attribute view. In Attribute view, you can only work with
dimensions, whereas in analytic view, you work with multiple dimension
tables linked to one fact table. This means that these two views do not allow
flexible use of dimensions and measures and have a basic way of data
modeling.
On the contrary, calculation views do not have such limitations and enable a
user to use complex calculation logic and combine measures from more than
one fact table. Along with this, you can use advanced SQL logics and multiple
layers of calculation logics while creating a calculation view. It gives you the
freedom to combine and create from a range of options like Tables, Column
Views, Analytic Views, Attribute View, etc. This enables a user to do
multidimensional reporting using measures and dimensions from different
sources.
Explore the Unique SAP HANA Features
Characteristics of Calculation View
Some important characteristics of the calculation view are given below:

 Calculation views support both OLTP and OLAP models.


 They support complex expression such as Case, Counter, IF.
 Supports special language such as R-lang.
 You can reuse Analytic Views, Attribute Views and even other
Calculation Views while creating a new Calculation View.
 Calculation views support analytic privileges.
 It supports SAP ERP specific functionalities such as currency
conversion, language, client handling, etc.
 Enables the user to combine measures from multiple tables.
 Users can use both column-based and row-based tables.
Scenario Panel in Calculation View
When you open a calculation view editor to create a new view, you will find a
scenario panel on the left with five options; Join, Union, Projection,
Aggregation, and Rank. A Calculation View in SAP HANA is created using a
combination of these options.
1. Join – A join option connects two source objects or tables into a single
object. It is also referred to as a join node in the view hierarchy. The join
types between two tables can be inner, left outer, right outer and text join.
2. Union – The union option performs a full outer join on n number of source
objects and creates a single object by combining their contents.
3. Projection – The projection option projects the table in a certain way. You
can use it to filter the columns of a table or add some columns before using it
in other nodes like aggregation, rank, union, etc. You can only use one source
object while working in the projection node. If you wish to create more than
one table than use separate projections for each. Projection nodes are used to
convert column-based tables into dim calculation tables.
4. Aggregation – In the aggregation node, you can perform aggregation on
selected dimensions and measures.
5. Rank – This is used to rank the values based on a criterion. You can define
the order by clause and partition in this node based on the modeling
requirements.

Steps to Create a Calculation View in SAP


HANA
In this section of the SAP HANA Calculation View Tutorial, we will learn how
to create a calculation view with a star join option in SAP HANA Modeler. A
star join is created when we need measures from more than one fact table to
use it in reporting.

Step 1: Select Tables


Open the SAP HANA Information Modeler and decide the tables which you
want to use in making the Calculation View. You can access the tables from
the Catalog folder under your SAP HANA system.
For understanding’s sake, let us assume that we are using four tables, two-
dimension tables, and two fact tables.

Step 2: Create a DIM information view


Go to the Content node and select the package under which you need to create
the calculation view. Right-click on the package name, select New then
select Calculation View.
Step 3: Converting dimension tables into DIM calculation tables
Before we start with bringing all the tables together, we need to convert the
two column-based dimension tables into DIM calculation tables. For this,
open a new calculation view and enter the name of the view (for
instance, DIM_CAL_1) and select the Data Category as Dimension.
Repeat this process again for every dimension table you have. (we have named
the second one as DIM_CAL_2)
Step 4: Adding dimension tables and columns
Now, add the dimension tables into the calculation view from the green Add
Object sign on the Projection section.
We will add the table EMPINFO (under the Projection section) in
the DIM_CAL_1 view. Similarly, add another dimension
table EMPRECORDS in DIM_CAL_2 calculation view.
Once the tables are added and columns from them are added in the final
output, save and activate the table by clicking on the green tick and arrow
button on the top bar.

Step 5: Create a calculation view


Now, after converting our two column-based dimension tables as DIM tables,
we will create the calculation view. Again, go to a preferred package under
the Content node. Right-click on the package name > New > Calculation View.
Enter the details for the new calculation view such as Name, Label, View
Type (Calculation View), Type, Data Category (CUBE). Check the “With star
join” box if you are creating a calculation view with a star join.
Step 6: Add measure/ fact tables
There are five types of operations given based on the scenario in which the
calculation view is being created. Those are Join, Union, Projection, Aggregation,
and Rank. All five perform different functions (as their name suggests).
We will create two projections and add one fact table in each projection. We
have added EMPFACT1 in Projection_1 and EMPFACT2 in Projection_2.
Select the columns to be available in the reporting view from both fact tables.
You can see the selected columns or fields in the Output section on the right.
Step7: Join the fact tables
Next, we will join the two fact tables (EMPFACT1 and EMPFACT2).
Select Join from the left Scenario panel. Drag and drop the two projections
(Projection_1 and Projection_2) in the Join section. The two projections will be
joined and shown in the join box.
Then, we will physically join the two fact tables with the common column.
Suppose EMPID is a common column in both the fact tables
(EMPFACT1 and EMPFACT2). Select the columns for output from the two
fact tables.
Now the selected columns from the two fact tables will be in a single join table.
The name of this join table is Join_1.
Must Learn – How to Create Tables in SAP HANA
Step 8: Create a star join
Next, we will join the Join table to the Star join section above it.
Also, we will add the two dimension tables
in DIM_CAL_1 and DIM_CAL_2 that we added earlier, into the final star join
calculation view.
So, we have added Join_1, DIM_CAL_1, and DIM_CAL_2 in the Star
Join section.
Step 9: Join dimension and fact tables.
Now that we have data from two dimension tables and a combined fact table,
we will join the fact (join table) with the two dimension tables and select the
final columns for output as shown in the image below.

A detailed view of all three tables will appear on the Details panel.


Step 10: Check Semantics
Moving on, we will go to the Semantics section to define the measures and
attributes. Click on the Auto Assign button to automatically assign columns as
measures and dimensions.
Step 11: Save and activate
Save and activate the final calculation view from the green arrow button.
Step 12: Preview data from selected columns
You can preview the data by clicking on the Data Preview button next to
the Save and Activate button.
In the data preview section, you can carry out analysis by creating
visualizations using the available measures and dimensions.

You can also change the type of visualization from a bar graph to a bubble
chart, line chart, pie chart, etc.

Summary
We learned about the complex information view that is Calculation View, its
characteristics, scenario panel and steps to create Calculation View in SAP
HANA.
We hope you found our explanation helpful. In case of any queries related to
SAP HANA Calculation View Tutorial, drop your comments in the comment
box below.

You might also like