Scenario : We have to create Decision Table for the requirement of Salary Hike
for Example if salary <= 40000 the employee should get Hike 5% else salary > 40000 the employee should get Hike 10%.
The Following are steps to create above scenario
Step 1) First create employee details table as shown bellow
insert below data in the above table
The output of the table
Step 2: Create Decision Table as follow’s
Right click on our package ->New->Decision Table
we can write/develop business rules with less/no programming knowledge and use the result data to analyze and perform comparisons against actual data with the help of Decision Tables.
Decision table is a way in business rules realm to formulate rules of business, company or corporation in a table structure.
Below slide We are giving Decision Table name “SALARY_HIKE”
You can get the plus symbol as follows
Click on the plus Symbol add our “EMPLOYEE_DETAILS” Table
Select Required columns from the Table
And Add as condition to “EMPLOYEE_SALARY” column,
Conditions: Conditions are the columns on which we will write our business rules. In our scenario, we will build the business rules based on columns “EMPLOYEE_SALARY”. Let’s add those two columns to conditions as shown below.
Create new column in parameters as shown below
Parameters: This are used to store result value after applying conditions or can be used to provide the values for conditions during runtime. Parameters can be used for both conditions and parameters.
click on new button
Add Action to “NEW_SALARY”
Actions: Actions are the columns that will be effected by business rules (conditions).
Next screen will be
click on Decision Table in scenario
Apply the below conditions
Save and Activate.
STEP 3: Create Calculation View
Right click on our package -> New-> create calculation view
Calculation View are used to perform complex calculations, which are not possible with other Views and used to consume Analytic, Attribute and other Calculation Views.
Create calculation View in Below scenario
take one projection for “EMPLOYEE_DETAILS” Table
Second Projection for “SALARY_HIKE” Decision Table
Then Join these two projections with “EMPLOYEE_ID” Column
A Join clause combines records from two or more tables /view in a database.
In JOIN use Inner Join with cardinality 1 to 1
creating new fields in views which are calculated based on some logic which may involve already existing fields in the table. Such a field is called Calculated Column in SAP HANA.
Create a Calculated column With the name “Final_Salary” and With the Expression as shown below.
In Aggregation select required fields
Save & Validate then
Save and Activate it.
Check the output
You can see the EMPLOYEE_SALARY Before hike in Blue Rounded Column along with Final_Salary in Red Mark as shown Below.