Skip to Content

Create One Forecasting Model, Automate Many with SAP Predictive Factory 3.0!

Many 1s.jpg

The release of SAP BusinessObjects Predictive Analytics 3.0 opens the door to powerful time series forecasting scenarios!

Our straightforward wizard-based approach makes it possible to create and save time series predictive models via a few clicks.

Since 3.0 was released, it’s possible to derive many predictive models from this very first model, based for instance on different geographies or product lines. 

The periodic retraining of this segmented model on fresher data can be scheduled. All the resulting forecasts can be written to an output table, and generate added-value data.

These capabilities are available in a nice and intuitive SAP Fiori-based user interface, the SAP Predictive Factory.

In the following step-by-step example, let’s imagine a retailer running brick & mortar stores. This company wants to forecast the number of customer visits in each of their stores so that they can make sure that the stores are staffed adequately and that the customer demand can be fulfilled.


Everything starts with the creation of a time series analysis model.

Time Series Analysis.png

The source data used is stored in a SAP HANA table. The table contains the historical data of the store visits, per store, from July 2010 to June 2016. The data is aggregated at a monthly level.

Select a Data Source.PNG

The order of the data is based on the DATE variable. A filter is set on of one the stores to create the initial model.

Order and Filter.jpg

The model will be created on the data of the first store (nicknamed Store_1).

Filter on Store_1.png

The Target variable is named VISITS, it is the aggregated number of customer visits per month.

Selecting Variables.PNG

The forecast is required for the next year to come – this is specified as 12 forecasts, one per month that needs to be predicted.

Summary of Modeling Parameters.PNGWhen debriefing the model, the following can be noticed: 

– the number of customer visits contains a general trend and cycles, which have been described by the time series model

– the horizon-wide MAPE (Mean Absolute Percentage Error) is equal to 0,033. The error is only 3.3% which means that the time series model describes the signal accurately.

Debriefing the Model.PNG

When comparing the signal (the real customer visits) and the forecast, the accuracy of the model can be noticed.

Signal vs Forecasts.PNG

The time series model can be saved locally. It can also be saved in the SAP HANA database that contains the data.

Saving the Model.PNG

In SAP Predictive Factory, a project dedicated to customer visit forecasting has been created.

SAP Predictive Factory Project.PNG

The model that was saved earlier on is imported in the project.

Import the Models.PNG

Model Imported.PNG

The initial time series model can be segmented. It means that a separate time series model is going be created for each store. This segmentation capability is available only for time series models in the 3.0 release.

Segment Model.PNG

The model is segmented depending on the variable STORE, it is part of the SAP HANA table.

The reference date for the training is set to June 2016, it means that all the data up to the last data point measured in June will be used to train the segmented model. 

Save and Train.PNG

Set Reference Date.PNG

The segmented model is created. Please note that the creation of the model is delegated to SAP HANA, thanks to SAP HANA’s Automated Predictive Library. It means that the data is not being moved out of SAP HANA in the model training process.

Model Training in Progress.png

20 different models have been trained for each store. The performance of each model is displayed. The segmented model is set as the active one.

Segment Performance.PNG

Tasks make it possible to automatically refresh the segmented model and make sure up-to-date forecasts can be delivered.

A task is defined to:

  • Be run every month, as the source table will be enriched with new records month after month.
  • Use the 5 last years of historical data (before the reference date) to train the segmented model
  • Forecast the next 12 months after the reference date.

Task Definition.PNG

The forecasting task is scheduled to be executed on a monthly basis and deliver predictions for the next 12 months after the reference date.

Task Definition Schedule.PNG

The data corresponding to the next 12 months forecast can be written back in the SAP HANA database.

Task Output Table.PNG

For the purpose of the example, let’s run the task based on today’s date and forecast the customer visits for next year.

Run Task.PNG

Once the task has been run, the performance over the different segments is displayed. The top segment is Store_15 with 2.17% of error, while the segment with the least good performance is Store_9.

Task Run.PNG

The forecast can be compared to the historical data, for any of the stores, like shown below.


As a conclusion to this step-to-step example, the SAP Predictive Factory represents a very powerful addition to the SAP BusinessObjects Predictive Analytics product family as it makes possible to create mass forecasting models, for instance for different geographies or product lines.

Similarly to this retail example, many applications can be imagined for manufacturing, telecommunications companies and in general every industry that requires visibility on the future!

We look forward to hearing from you on the business cases made possible with the SAP Predictive Factory!

You must be Logged on to comment or reply to a post.
    • Hello Ivan, thanks for your feedback!

      Predictive Factory is licensed as part of our SAP BusinessObjects Predictive Analytics Suite and requires a dedicated key code.

      Best regards,


  • Hi Antoine,

    Thanks a lot for this instructive tutorial that you have shared with us.

    I was wondering whether it is posibble to create separeted time series using Sql Server or text file or do we have to have the data on HANA as it's HANA's APL who trains the model?


    • Hi Erdem,

      It's an interesting question as people usually tend to do a too tight coupling between Predictive Factory and SAP HANA.

      All the data sources that are claimed as being supported in our 3.0 PAM by Automated Analytics are also supported by the Predictive Factory. This is not crystal-clear in the PAM, and I'll make sure we fix this moving on.

      3.0 PAM link:

      Of course, as you mentioned the extra benefit of using SAP HANA, is that, provided that the APL library is deployed on your SAP HANA server, the creation of the models will be delegated to SAP HANA and thus, intensive data transfer between the SAP HANA and the SAP Predictive Analytics Server will be avoided.

      I hope this helps,

      Thanks & regards,


      PS: we have an internal community to support SAP employees ūüėČ

  • Hello Antonie

    Thanks for the useful post. I have one query though.

    Can we have a connection between Predictive Factory and SAP BW?-so that we can store the KPI/Prediction back into BW. I know we score the Models in Factory-but we need to find a way to put it back into BW (and not just Factory).

    The other way was that Does SAP BW understand PMML? Because if it does-then we don't even need Factory right (as even factory consumes PMML)? We can directly operationalise our model using PMML integration into SAP BW...I read one of the papers that ADAPA is used for integration wit SAP applications-but am not sure if it is used for integration of PMML with SAP BW...Let me know your opinion on this.

    Best Regards


    • Hi Data.Geek,

      as Antoine mentions above, the data can be written back to the HANA database directly. BW on HANA would pull it up from just like any other DB table. By the same token, BW info providers can be generated into their HANA counterparts and PA then takes those as input to its modeling magic.

      Br, Jan

      • Hello Jan Fetzer.

        Can you direct me to a link where I can understand it in a more granular manner?

        I would like to understand how the data is written back to HANA-Is it via PMML? or something else... Does it mean that we don't require Predictive Factory?

        But in another question-Can there be a link established between Factory and BW or other SAP System as we would like to operationalize the model not only in Factory but also in the internal company data system?

        Best Regards


  • Hi Antonie,

    Hope you are doing good. By any means can I get the data set for the same. My ID is jothikumar dot rj at gmail dot com.

    Anxious to simulate the same from my end. Hoping to hear from you.




  • Please send me an email and I'll share the dataset with you. Please see my email address on my profile. Thanks & regards Antoine


  • Hi Antoine,


    Please could load the dataset to github or similar and post the link.

    My question relates to the structure of the dataset. You note that the source dataset is aggregated by month and the forecast will be 12 monthly periods into the future. However, in the screenshot you are clearly using a Date type field as the time component. Does this mean you are using some arbitrary date in each month for example first or last day of each month to represent the month. If yes, then I assume you are doing this because of a current limitation in Predictive Factory. From my trials and errors using this tool I found that in Predictive Analytics Automated Modeler I can build a time series using a sequential Integer as the time component, for example a number to represent the month numbers. However, this model cannot be imported into Predictive Factory because in PF only a date field is recognised as the time component. Is this correct? I would love to see your dataset to simulate in my environment.




  • I also think it's worth noting that at this stage it seems that HANA Information Views (i.e. calculation views) are not supported for segmenting models in predictive Factory:


    • What is the version that you use? Can you please raise a support ticket on the same? I would like to investigate this. Kind regards Antoine


      Hi Lance,

      After discussing this in-house, I have some news to share with you.

      The problem exists in SAP PA 3.1 and has been resolved in SAP PA 3.2.

      In 3.1 you have a workaround which consists in using a SAP HANA server instead of a Automated Modeling Server. Please give it a try.

      Kind regards & thanks for raising this to my attention.



      • hi Antoine,

        Thanks for your responses. I just wanted to add some more details to your proposed workaround above for the benefit of others. I have tested and confirmed that I am able to use a Calculation View as a dataset for a segmented model when I use a HANA server as the modelling server for the input dataset. However, it's worth pointing out that you need to use an Automated Modelling server in your project first in order to create the model (or import the model) in Predictive Factory. So, in your project it is necessary to have both an Automated Modelling Server and a HANA Server. the process is then as follows:

        1. create calc view in HANA and set a variable on the dimension that you want to segment your time series model on (i used a single entry optional variable)
        2. create model using calc view as input dataset through data connection of an Automated modelling server.
        3. set a value for the variable (predictive factory provides an interface to fill the variable)
        4. do not segment this model
        5. save and train
        6. once a successful version is created you can select this version and click "segment"
        7. now select the same calc view however connect through the HANA server, not the Automated Modelling server
        8. set the variable to "No Filter"
        9. segment by the dimension upon which the variable is created

        this worked for me. It obviously adds a step to the process but the end result is still a time saver over having to created each variation individually.


        One question regarding segmentation - is there any plan to allow for segmenting models by multiple dimensions? currently it is only possible with one dimension. So in our case we want to generate a forecast by Product Category and Customer Segment. So I am having to create multiple models for each product category and within each model I am segmenting by Customer Segment. It would be fantastic if I only had to create one model for the forecast and then the system could automatically create the possible combinations of Product Category and Customer Segment.





        • Hi Lance, thanks for the great interaction! As I mention above, We fixed this problem in 3.2 planned to be released next Monday. So please give it a try and you will just need to set up an Automated modeling server connected to Hana via the ODBC connection. On your idea of segmenting over multiple fields, you are spot on on the requirement and this is something I often hear. Would you be so kind to raise an idea in our Idea Place for predictive? Then we can evaluate the overall traction on this one and act accordingly. Again thanks for the feedback. Cheers Antoine

  • By version, I mean I please need

    1 the one of the Factory

    2 the one of the Desktop

    3 the one of the Server

    What does your view contain?

    kind regards



    Hi Antoine, does this guide align to the latest versions of PA and PF.  A few things were different in my versions.  Some of the entry field descriptions were different.  I was not sure if I took a wrong turn or maybe the descriptions have changed in the products since this was created.


    Best Regards

    Kevin Geiger.

  • Hi¬†Antoine,

    thank you for the detailed steps. Really appreciate your time. I was able to create a model and saved locally. Now, I am trying to save it to the SAP Predictive Factory, to do that I created a project and am trying to load the .kidx file using the "import the models related to your business case option". Is this how we save the models in the server ?

    Thank you!

    • Indeed! You should save the model to a specific folder then point to that folder. Please note that with the recent versions of Factory you do not need the two-step process and you create time series, classification and regression models directly from Factory. Kind regards Antoine

  • Hi Antoine,

    Thanks a lot for this wonderful tutorial.

    I was trying to write the scored data back to Hana server. When I select the Single Table (Overwrite Option), I only get the scored data for store 9 (maybe because it overwrites all the other store's scored data). I was wondering if it is possible to write the scores of all the stores in one table in SAP Hana database. I don't want to generate different table for each store. Moreover, the data I am working with has 300 items, and generating 300 tables would not be feasible.

    It'll be great if you could help (I am using Predictive Factory 3.2).


      • Antoine,

        I tried using the other option, One Table Per Run, and it just creates one table and only writes the score for Store 9. It'll be great if you could try it out.



          • Antoine,

            It works now, thanks for the help.

            I had another question, I was using SAP HANA 1.0 and PF before and the APL delegation happened as you mentioned. However, I have to deploy the project in HANA 2.0, and now when I connect it to Predictive Factory, the APL delegation does not take place and it seems like the data is leaving HANA and the computation is not happening on the server. I download APL on the SAP HANA 2.0 and tested it.

            Here are the old and new computation screenshots:

            APL delegation happens when I import the data from SAP Hana 1.0

            This is what happens when I import the data from SAP HANA 2.0

            This step is very import for my project since the speed of training and scoring model increases considerably when the computation happens with HANA. Is there anything I am missing out on here?

            It'll be great if you could help.




  • Varun, can you please post this as a dedicated question (use tag: SAP Predictive Analytics) and I'll reply? Usually we do not handle questions via comments, as a SAP community best practice.

    Thanks for your understanding, kind regards