By now, you must be familiar with the concepts of decision table - in general. For more refer blog: Decision Table in SAP HANA - Concept. Before I start the explaining various flavors of modeling Decision table in SAP HANA, there are few things that you need to know.
To model a simple decision table without any database table, you use Parameters. Decision table modeled on Parameter falls in 2nd category of Select – where the result set can be used for simulation purpose and is not based on actual database content.
Parameters are relatively simple. This means that they are not only easy to understand, but also easy to implement and does not have to rely on complex database table structures. The benefit comes to affect when a trend has to be analyzed for a certain change in the value of business rule conditions or actions without original content. For Example - A vendor wants to know how much affect a seasonal discount will cause in its overall sale. Here he can create Sales and Seasonal Discount as Parameters to observe the trend.
Let us start with the steps that would guide you to create and use decision tables with parameters. First step towards it is to create decision table and next is to create Parameters. What you see below is the snapshot of how to create the Parameters in the decision table -
Figure – 2.1: A Parameter created from Decision Table Output view
Next, define condition and action columns based on these Parameters and fill the values as shown
Figure – 2.2: A Decision table modeled on Parameters to calculate DISCOUNT based on QUANTITY and AMOUNT of the Order placed by the Customer
Finally, Save, Validate and Activate the decision table. Once activated, the decision table is now ready to be consumed in applications.
Decision table is modeled in HANA Studio and only when activated can it be consumed in applications. This consumption is done by making a call to decision table procedure – generated after activation. You can find the procedure at
HANA System/Catalog/ _SYS_BIC/ Procedures/<package-name>/<decisiontable-name>
To execute this decision table use the following syntax and watch the result set.
call “_SYS_BIC”.”<package-name>/<decision-table-name>”(IN… parameters, ? … OUT parameters)
Watch out the following in call statement–
You can see below the call statement to the execute the decision table used in this example:
call “_SYS_BIC”.”rulesonhana/SIMPLE” (4000,300000,?)
Also, see how the simulated DISCOUNT is fetched from decision table based on the input values:
Figure 2.3 - SQL editor will the call statement and the results view
You must be wondering how does the evaluation of decision table was achieved. Here is the answer to it : The red mark in the figure below says the story:
Let me summarize in general how to model decision table using Parameters –
For more refer http://help.sap.com/hana_platform > HANA Developers Guide > Setting up the Analytical Model > Creating Decision Tables
Through this way of modeling decision table, you can achieve data simulation, which happens based on the conditions and action set of the decision table.
Hint: You may also use data preview feature of SAP HANA to analyze the trend by providing relevant input data. Anybody who is interested can also see the youtube video (by Thomas Jung) that features the modeling of decision table on Parameters. There is also a Step-by-Step guide that would help you model and consume decision table for your need.
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 |
---|---|
24 | |
13 | |
12 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 |