Here is the summary of what is covered in this article:
This article covers the various ways to create analytic model, creation of analytic model from analytic dataset with input parameters for customization of data result, how to pass Input parameters from analytic dataset to analytic model, deletion of input variables in analytic model in SAP Datasphere.
Before we start with the article, here is some basic information about Input parameters and analytic models in SAP Datasphere.
Input parameters in SAP Datasphere
Input parameter is a run time parameter to generalize a model and customize the result of the model. For more details on how to create a analytic dataset with input parameters, please go through this.
What is analytic model in SAP Datasphere?
Analytic model in SAP Datasphere allows multi-dimensional and semantically rich analytical modelling to answer business questions easier, faster and more efficiently. For more details, please go through this.
How to pass Input parameters from analytic dataset to analytic model
Assuming that we have our analytic dataset with input parameters ready, lets proceed with creation of new analytic model with this analytic dataset.
Two ways to create analytic model
In the data builder, let’s start with creation of a new analytic model. A new analytic model can be created by using the new tile icon Analytic model.
An alternative option is to open the analytic dataset and click on create analytic model from the properties panel.
On creation of a new analytic model from a analytic dataset with input parameters, you are prompted with the option to choose the properties to be copied to the analytic model.
For input parameters, you need to choose one of the options:
- Map the input parameter to a new variable in analytic model. This is the default option. In this case, a new variable with same name gets automatically added in the analytic model. This newly added variable is of type input variable. You can go to model properties and check these input variables under variables section.
- Set the value to input parameter. In this case, you need to enter a value for the input parameter. In case you need to change this default value of the input parameter, you can change it any time from fact model properties. In fact model properties, go to input parameters and choose the set value option for the required input parameter.
If you create analytic model from analytic dataset properties, the above prompt for selection of input parameters would not be available. All input parameters are added to analytic model as input variables. If you do not need all these variables, you can keep only the variables required and delete the variables which are not needed. Deletion of variables is discussed in detail later.
Once you have chosen the required options for your input parameters, click on Preview to check the input variables and set the dynamic value for these variables.
In the data preview of analytic model, use ‘Set Variables’ option to change the value of input variables. Please note that the value of input variable set using ‘Set Variables’ in data preview is only for checking the impact of variables in data Preview. It doesn’t change the actual default value of input variable of the analytic model.
Deletion of Input Variables
As Input variables are mapped to input parameter, direct deletion of input variable is not possible. To delete the input variable, we need to remove the mapping between input parameter and input variable. To delete a input variable:
- Go to fact model properties. Change the setting of the input parameter to from ‘Map to’ to ‘Set Value’ and enter a default value for input parameter.
- As we have removed the mapping between input parameter and input variable, go to analytic model properties and delete the input variable.
Once satisfied with the analytic model, save and deploy the model. This deployed analytic model can be used to start building stories with Optimized Design Experience in SAC.
Now that you know about input variables in analytic model and using it in SAP Analytics Cloud Story, how about discovering more about SAP Datasphere? Explore our community topic page to learn more.