Quantcast
Channel: SCN : Document List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 1183

What-If analysis with Design Studio and HANA as backend.

$
0
0

The aim of this blog is demonstrate the creation of a ‘What-if’ analysis report with SAP design studio and HANA as backend database. Let’s consider a scenario ,where we have to decide between ‘Buy Now’ and ‘Buy Later’ options, based on the below user inputs.

  1. Unit Price
  2. Quantity
  3. Discount
  4. Delay Days

 

pic1.png

 

On click of the ‘Submit’ button, the values entered in the input fields (Unit Price,Quantity,Discount & delay days) will be passed on to the ‘Input parameters’ of the HANA data model.

 

pic2.png

 

Below script is written on the ‘On-Click’ event of the submit button to pass on the values to the Input parameters of the HANA model.

 

pic3.png

 

pic4.png

 

Here ‘DS_WHATIF_ANALYSIS’ is the data source that is built in design studio on top of the HANA data model. Based on the input values(a,b,c,d), the HANA model will determine the  ‘Buy Now’ & ‘Buy Later’ values in a chart in design studio output.

pic5.png

 

HANA Data Model:

             The HANA model is based on a table (has 2 columns containing the inflation rate for each month).

 

 

pic6.png

 

pic7.png

 

Create 4 input parameters (Day_Delay, Unit_Price, Quantity & Discount) of parameter type ‘Direct’. These are the input parameters that will receive the input values entered by the user in the report.

 

pic8.png

 

Create another input parameter ‘Inflation_Curr’ of parameter type ‘Derived from table’. This is the current inflation rate, which will be maintained in a custom table.

 

pic9.png

 

Create the below calculated columns in the same sequence as below,

 

pic10.png

 

  1. Calmonth_Now1:

pic11.png

 

2.Calmonth_Now

 

pic12.png

 

3.Calmonth_Later1

                Here we are adding the delay days from the input to the current date to get the Buy later period.

 

pic13.png


4. Calmonth_Later2:

pic14.png


5.Now_Flag


pic15.png


6.Later_Flag:


pic16.png

 

7.Inflation_Now:

 

pic17.png

 

 

8.Inflation_Later

 

pic18.png

 

9.Incremental_Inflation

 

pic19.png

 

10.Buy_Now:

                Buy now will consider ‘discount percentage’ and ‘Holding Cost’ into consideration.

 

pic20.png

 

11.Buy_Later:

                Buy later will consider the inflation rate for the delayed period into consideration.

 

pic21.png

 

Now let’s activate the model and test the it.

 

pic22.png

 

Enter the values for the input parameters.

 

pic23.png

 

We can see the value of ‘Buy Now’ and ‘Buy Later’ prices now. The same will be represented in design studio as a chart, when we click on the submit button.

 

pic24.png

 

 

Design Studio report Output:

 

pic25.png

 

Based on the above output, ‘Buy Now’ seems like a better option.


Viewing all articles
Browse latest Browse all 1183

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>