Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

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

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.

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.

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.

HANA Data Model:

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

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.

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.

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

  1. Calmonth_Now1:

2.Calmonth_Now

3.Calmonth_Later1

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


4. Calmonth_Later2:


5.Now_Flag



6.Later_Flag:


7.Inflation_Now:

8.Inflation_Later

9.Incremental_Inflation

10.Buy_Now:

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

11.Buy_Later:

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

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

Enter the values for the input parameters.

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.

Design Studio report Output:

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

Labels in this area