Predictive Analytics Using Application Function Modeler
This tutorial series will cover a pair of sample projects utilizing the predictive analytics capabilities of SAP HANA, express edition. This tutorial will show you how to use a Application Function Modeler to access the predictive analytics library.
Overview
You will learn
- How to use the Predictive Analysis Library through SAP HANA Studio
Prerequisites
Prerequisites
- [Predictive Analytics Using SQL Script]
Steps
Next Steps
- Find more Predictive Analysis Library tutorials on the SAP HANA Academy YouTube Channel
Intro
This tutorial creates the same models as the previous tutorial by only using template modules within SAP HANA Studio. For more tutorials on using Predictive Analysis Library, see the SAP HANA Academy YouTube Playlist.
In your SAP HANA Studio window, hover over Window -> Perspective -> Open Perspective. Select SAP HANA Development if is available, otherwise, click Other…. From the drop down list, select SAP HANA Development.

The SAP HANA Development perspective opens.
Through the Repositories tab, right-click on your user login for your tenant database and select Create Repository Workspace.

The Create New Repository Workspace window opens.
Make sure your user login for your tenant database is selected. You may use your default workspace, or untick the Use Default Workspace box and create a new workspace by filling in Workspace Name and Workspace Root. By default, these locations are the same as the home repository you select when starting Eclipse and SAP HANA Studio.

Click Finish to create your new workspace.
Right-click on your new repository workspace and select New -> Repository Package.

The Create Repository Package window opens.
Give your package a name and click Finish to create the package.

Right-click on your new package and select New -> Other….

The New window opens.
Scroll down to SAP HANA -> Database Development -> Flowgraph Model. Click Next >.

The New Flowgraph Model window opens.
Ensure that your new package is highlighted. Give your flowgraph a name. Ensure that Flowgraph for Activation as Stored Procedure is selected. Click Finish.
Note: SAP HANA Studio will automatically add
.hdbflowgraphto your file name.

Your new flowgraph opens.
Under the Predictive Analysis Library window, select Time Series Analysis, scroll down and drag and drop Auto ARIMA onto your flowgraph.

Under the General window, drag and drop Data Source onto your flowgraph.

The Choose a Table or a View window opens. For this example, search for and select the STOCKS (PAL) table. Click OK.

Hover over the STOCKS block. Click and hold the Connect icon

Under the General window, drag and drop Data Sink (Template Table) onto your flowgraph.

Hover over the AUTOARIMA block. Click and hold the Connect icon

To view the results you will need to change the RESULT and TEMPLATESINK properties. Hover over RESULT under AUTOARIMA. Click the Properties icon

The Properties window opens. Click Signature. Change VALUE Length to 5000.

Change the TEMPLATESINK properties. Hover over TEMPLATESINK and click the Properties icon

Under the Properties window, add your user schema to Authoring Schema. Add a name for Catalog Object. You may also check the Truncate Table box.

Change the properties of the flowgraph. Right-click on the white space and select Properties.

By Target Schema, add your user schema.

Click the Activate icon
Click the Execute icon
Note: If you receive an error during this step, see the troubleshooting section below.
Return to the SAP HANA Administration Console perspective. Under your user login to your tenant database, cascade down from Catalog -> User -> Tables. Right-click on Catalog_Object and click Open Data Preview.
Note: The Catalog Object is named earlier in this tutorial.

You may notice that this data is identical to Step 2: Run the Model SQL Script in the previous tutorial.
Return to your flowgraph.
Under the Predictive Analysis Library window, select Time Series Analysis and scroll down and drag and drop ARIMA (Forecast) onto your flowgraph.

Hover over the AUTOARIMA block. Click and hold the Connect icon
Change the PARAMS_2 by hovering over it and clicking the Properties icon

Under the General window, drag and drop another Data Sink (Template Table) onto your flowgraph.
Hover over the ARIMAFORECAST block. Click and hold the Connect icon
As before, change the TEMPLATESINK properties. Hover over TEMPLATESINK_2 and click the Properties icon

Click the Activate icon
Click the Execute icon
Go to the Systems tab. Refresh your tenant database. Find the results table under your user login. Go to Catalog -> User -> Tables -> Second_Catalog_Object. Right-click on the table and select Open Data Preview.

You will notice that this data is identical to Step 4: Run the Predict SQL Script in the previous tutorial.
When you Activate your Auto ARIMA model, you may encounter this error:

To fix this error, open the Problems window. Go to Window -> Show View -> Other…. From there, go to General and select Problems. Click OK.

You will see the error in the log. Right-click the error and click Quick Fix. The Quick Fix window opens.

Click Finish. A message explaining the fix will appear.

Click OK.
Click the Activate icon
Additional Information
- Find more Predictive Analysis Library tutorials on the SAP HANA Academy YouTube Channel
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.