You are on page 1of 5

SAP HANA Developer Center: Decision Table

on HANA Modeler Views


Posted by Archana Shukla Oct 9, 2013
Database table is the most common way to model decision tables. Users are accustomed
to column-based business rules which are simpler to create and easy to transform for
consumption. Even though the database tables can be the first step to prepare decision
tables, there are also users who are already familiar with HANA modeling views like Attribute
View, Analytical View, Calculation View etc. and would want to design rules based on these
views. In this section we target these users and explain how to model decision table using
information views and its advantage.

Each SAP HANA modeling view is designed for specific purpose and is efficient
when used in that context like Analytical View is best suited for analyzing
calculation and aggregation - of the data that is arranged in star-like-schema.
This is done by different set engines in HANA like JOIN engine is used for
Attribute view, Calculation Engine is used for Calculation views etc. These
engines are optimized to produce best results in quick time.

To leverage the high performance capabilities of these engines, users may choose to
model these views first and then use them to write business rules in form of decision tables.
By default the Decision Table would be executed by Join Engine. If the decision table is
designed on the modeler views, then it is executed by their respective engine that are
already optimized to provide improved performance.

With assumption that you already know how to work with modeling view, let us start with
designing decision table using modeling views. For this example, I have picked Analytic view
which has an aggregation (SUM) to calculate the sales of a particular electronic gadget. This
view we use in decision table to give DISCOUNT on the products.

First model analytic view using ORDER and PRODUCT database tables. Things to
mark

Generated by Jive on 2013-11-19+01:00


1

SAP HANA Developer Center: Decision Table on HANA Modeler Views


QUANTITY is aggregated as SUM
Note the columns selected from the two tables to model Analytic view. These are regarded as Output of
the Analytic view.

Figure 4.1 - Overview of the Analytical View modeled on ORDER and PRODUCT tupes.
This Analytical view will be later used to model decision table

Next, design decision tables on this Analytic view. Things to mark


The Output of the Analytic view appear as options to model the decision table

Generated by Jive on 2013-11-19+01:00


2

SAP HANA Developer Center: Decision Table on HANA Modeler Views

Figure 4.2 - Data Foundation with Analytical view and the Output view showing the
Condition and Actions columns

Fill the decision table with values -

Figure 4.3 - Decision table with values

Finally, Save Validate and Activate the decision table. Your decision table is now
ready for consumption. As already explain call the generated procedure for the
respective decision table. Few things to mark here are
QUANTITY is aggregated as SUM in original Analytic view

Generated by Jive on 2013-11-19+01:00


3

SAP HANA Developer Center: Decision Table on HANA Modeler Views


When QUANTITY column is used in Decision Table it is equivalent to SUM of QUANTITY
column
OLAP engine which is meant to handle efficiently aggregation and other calculation based
on start schema - is used when decision table is executed. In the first screenshot below
you see some contents from ORDER table marked as RED these are those Auzuro Handset
product which is mentioned in the decision table.
In the second screenshot below you would notice that QUANTITY values for each product
-are summed from the database content like Auzuro Handset (PRODUCT ID: SAM_1000123)
has 5 entries with SUM(QUANTITY) = 18. Similarly Mattle Mobile (PRODUCT ID: APP_1000124)
has 3 entries with SUM(QUANTITY) = 22 etc.
Finally you see DISCOUNT updated for only Auzuro Handset product as per the decision table

Figure 4.4 - Content of ORDER tuple (top) and SQL Editor with call statement (below)
showing the decision table comsumption

Generated by Jive on 2013-11-19+01:00


4

SAP HANA Developer Center: Decision Table on HANA Modeler Views

As Parameter is used in the Action, the result set is a simulated result and do not
modify the DISCOUNT column values of the original database table i.e. ORDER.
Let me finally summarize the steps again 1.
2.
3.
4.
5.
6.

Create one of the modeler view Attribute, Analytical or Calculation view


Create Decision table in HANA Studio
Drag and Drop these view onto Data Foundation section
Select Output of the modeler view as Conditions and Actions columns of the decision table
Set the values of Condition and Action
Save, Validate and Activate

For more refer http://help.sap.com/hana_platform > HANA Developers Guide > Setting up
the Analytical Model > Creating Decision Tables

Thus, decision table can be designed on modeler view and efficiently addresses the
performance bottlenecks which might occur with use of database tables. However, an initial
knowledge and recommendations on working with modeling views is required to completely
utilize the specialization, parallelization and performance optimizer capabilities of these
engines.

Other Related Blogs

Introduction - Big Data Decision Making using Decision Tables


Decision Table in SAP HANA - Concept
Getting Started - Model simple decision table
Decision Table on HANA Database Tables

Upcoming Blogs in Store


Decision Table on Table Type
373 Views Tags: hana, business_rules_management, in-memory, rules, decision_table, sp06, sp05, modeler_views

There are no comments on this post

Generated by Jive on 2013-11-19+01:00


5

You might also like