Skip to Content

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

/wp-content/uploads/2015/09/pic1_796509.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.

/wp-content/uploads/2015/09/pic2_796511.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.

/wp-content/uploads/2015/09/pic3_796512.png

/wp-content/uploads/2015/09/pic4_796513.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.

/wp-content/uploads/2015/09/pic5_796517.png

HANA Data Model:

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

/wp-content/uploads/2015/09/pic6_796519.png

/wp-content/uploads/2015/09/pic7_796520.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.

/wp-content/uploads/2015/09/pic8_796521.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.

/wp-content/uploads/2015/09/pic9_796522.png

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

/wp-content/uploads/2015/09/pic10_796526.png

  1. Calmonth_Now1:

/wp-content/uploads/2015/09/pic11_796527.png

2.Calmonth_Now

/wp-content/uploads/2015/09/pic12_796528.png

3.Calmonth_Later1

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

/wp-content/uploads/2015/09/pic13_796529.png


4. Calmonth_Later2:

/wp-content/uploads/2015/09/pic14_796530.png


5.Now_Flag


/wp-content/uploads/2015/09/pic15_796532.png


6.Later_Flag:


/wp-content/uploads/2015/09/pic16_796533.png

7.Inflation_Now:

/wp-content/uploads/2015/09/pic17_796534.png

8.Inflation_Later

/wp-content/uploads/2015/09/pic18_796541.png

9.Incremental_Inflation

/wp-content/uploads/2015/09/pic19_796542.png

10.Buy_Now:

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

/wp-content/uploads/2015/09/pic20_796543.png

11.Buy_Later:

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

/wp-content/uploads/2015/09/pic21_796547.png

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

/wp-content/uploads/2015/09/pic22_796548.png

Enter the values for the input parameters.

/wp-content/uploads/2015/09/pic23_796549.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.

/wp-content/uploads/2015/09/pic24_796553.png

Design Studio report Output:

/wp-content/uploads/2015/09/pic25_796554.png

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

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply