Predictive Analytics is currently a hot topic, but it’s also a rather complex topic. In one of our previous blogs, What is Predictive Analytics? written by my colleague Sander, the foundation of SAP Predictive Analytics was clearly explained. In this blog we’ll take a look at the predictive capabilities of the SAP HANA platform itself.

How to access the SAP predictive functions?

One of the ways HANA increases performance is by executing complex calculations, like predictive computations, in the database instead of at the application server. SAP has grouped functions for particular topics together into the Application Function Library (AFL). The predictive functions have been grouped together in the Predictive Analysis Library (PAL) which is part of the AFL.

The PAL contains a set of predictive analysis algorithms in a number of different categories like clustering, classification and regression. Over all the PAL contains 60+ algorithms including for example K-Means, KNN and Polynomial Regression algorithms. For a complete list of categories and algorithms please read the HANA PAL documentation.

The Predictive Analysis Library in SAP HANA.

The PAL can be accessed by SAP HANA SQL Script, an extension to SQL which adds control-flow capabilities and the ability to define complex application logic. However, it can be quite daunting to use the PAL if you’re less experienced in SQL Script and/or the inner workings of the predictive method(s) you’re using. Therefore SAP implemented a number of tools to make the PAL easier to use for developers.

Create flowgraph models with SAP HANA Studio

The Application Function Modeler (AFM) is part of the SAP HANA Studio and it is used to create flowgraph models. A flowgraph models a complete dataflow in HANA Studio and can contain:

  • Tables, views and procedures;
  • Relational operators like joins and unions;
  • Functions from the Application Functions Library including PAL functions and R scripts;
  • Attribute and Calculation Views.
  • With the AFM it is very easy to add PAL function components to your flowgraph, configure its parameters and input/output tables and generate the stored procedure, all without writing a single line of SQL Script code. If you need other predictive and statistical functions that are not included in the PAL (yet), you can integrate R scripts into your AFM flowgraph as well. R is an open source language for statistical computing and graphics. It is highly extendable and at this moment there are over 5000 different (statistical) R packages available.

A flowgraph with PAL function components added.

New: SAP Automated Predictive Library

The AFM has already made the use of PAL functions a lot easier, because of its automatic code generation. However, you still need a solid statistical background to be able to understand how to use the PAL functions. With the introduction of SAP Predictive Analytics 2.0, SAP added another predictive library to the AFL on HANA: the SAP Automated Predictive Library or APL. Even though the APL is an AFL library, it is not part of the base HANA platform, but can be installed on HANA when you have purchased SAP Predictive Analytics 2.0.

So what is SAP Automated Predictive Library and how is it different to PAL? According to the APL documentation “The SAP APL is a set of functions that you can use to implement a predictive modeling process to be able to answer simple business questions on your customer datasets”. This means that you can effectively use the predictive models in the APL without having advanced statistical knowledge.

With this release of the APL it contains the following types of models to answer your business questions:

  • Classification / Regression models;
  • Clustering models;
  • Time series analysis models.

This will be expanded in future releases of SAP Predictive Analytics.

Overview of SAP’s predictive capabilities within the SAP HANA (Cloud) Platform.


  • AFL = Application Function Library
    A collection of libraries in SAP HANA that can be used to answer specific business questions with SQL Script.
  • PAL = Predictive Analysis Library
    A library with over 60+ statistical and predictive functions, that is part of the AFL.
  • AFM = Application Function Modeler
    An extension in HANA Studio create dataflows using graphical flowgraphs. This makes AFL and PAL easier to use.
  • APL = Automated Predictive Library
    The AFL library provided with SAP Predictive Analytics. It can be used for predictive solutions by users without an advanced statistical background.


With HANA and Predictive Analytics, SAP provides a spectrum of predictive solutions to different types of users. Both Data Scientists and users without a large statistical background can both effectively use the predictive solutions of SAP to solve their business questions.

Required analytics skills needed to be able to work with SAP’s predictive offerings.

Big Data and Predictive are hot topics for the upcoming years. Interested in this topic and in the possibilities offered by SAP?