
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 –
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 –
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 –
Figure 4.4 - Content of ORDER tuple (top) and SQL Editor with call statement (below) showing the decision table comsumption
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 -
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
Upcoming Blogs in Store
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
12 | |
12 | |
11 | |
10 | |
9 | |
9 | |
7 | |
7 | |
7 |