Business Intelligence

Integration of Predictive Analytics Functions in SAP Analytics Cloud

Been itching to unlock the power of predictive analytics in SAP Analytics Cloud? Learn how Smart Discovery, Search to Insight, and Data Change Insights can help you forecast trends, uncover hidden patterns, and transform your data into actionable insights.

 

In addition to the classic BI functionalities, SAP Analytics Cloud offers so-called predictive analytics functions, which enable you to proactively identify problems and opportunities instead of just reacting to them. In essence, they help you predict the future. Various APIs are also provided in stories for these functions, which we’ll take a closer look at now.

 

Smart Discovery

Let’s start with the smart discovery function, which uses machine learning to analyze your data and help you put your data into a specific context, discover new data, or find previously undetected relationships among your data. We’ll cover smart discovery-related APIs in the following sections.

SmartDiscovery

The SmartDiscovery API consists of two different methods:

  • buildStory
  • generateUrlToBuildStory

With the buildStory method, you have the option of creating a smart discovery URL that you can provide as a hyperlink in a dialog. An end user can then click that hyperlink to open the smart discovery story in a new browser window.

 

Availability on Mobile Devices: The smart discovery function is not available if you open it via a mobile device or a publication.

 

Another method of this API is the generateUrlToBuildStory method, which you can use to create a smart discovery URL. It doesn’t open a dialog, but you can use the URL as a hyperlink on images or buttons, for example.

SmartDiscoveryDimesionSettings and SmartDiscoveryStructureSettings

The SmartDiscoveryDimesionSettings and SmartDiscoveryStructureSettings APIs contain various methods that you can use to create the dimensions and structure settings for a smart discovery. You can copy dimension filters of a dimension into your page filter and set various properties, and you can also show and hide the properties panel.

 

The code below shows how you can use these methods. For example, you can place the following code on a button that is used to call the smart discovery function.

 

var ds = Chart_Forecast.getDataSource();

var members = ds.getMembers("Product_3e315003an");

var SDsetting = SmartDiscoveryDimensionSettings.create(ds, "Product_

3e315003an",[members[1]]);

SDsetting.

setIncludedDimensions(["Location_4nm2e04531", "Store_3z2g5g06m4"]);

SDsetting.setIncludedMeasures(["[Account_BestRunJ_sold].[parentId].&[

Gross_Margin]","[Account_BestRunJ_sold].[parentId].&[Discount]"]);

SmartDiscovery.buildStory(SDsetting);

 

When you execute this, a window (shown in the next figure) first opens in which you must confirm the start of smart discovery.

 

Dialog in Smart Discovery

 

Once you’ve started smart discovery, a new tab will open and you’ll first be shown a loading animation.

 

Loading Smart Discovery in New Window

 

Once the loading process has been completed, you can create your desired destinations and entities as well as advanced settings. This process will resemble the one depicted here.

 

Executing Smart Discovery

 

Once you’ve made your settings, you can run your smart discovery function. You can see a possible result below.

 

Result of Smart Discovery Function

 

Search to Insight

The search to insight function of SAP Analytics Cloud offers an interface in which you can query data using natural language. It lets you ask questions, get your answers from the data models, and start a new story.

 

Here, you can ask questions like these (depending on your data):

  • How high was the turnover for Germany?
  • Which item was sold most frequently in 2021? 

Supported Languages: The search to insight function is currently only usable with English words. The SearchToInsight API allows you to open and close the search to insight dialog. You can also insert your search to insight results into a chart or work with variables.

 

Availability on Mobile Devices: The search to insight dialog is currently not supported for mobile devices.

 

Data Change Insights

With the data change insights function, you can create snapshots of your data to compare them with one another. You can send these results by email or an app notification.

 

The API provides you with various methods for comparing the current status of the application with a snapshot or two snapshots. You can also save a snapshot or open the subscription dialog.

 

Editor’s note: This post has been adapted from a section of the book Application Development with SAP Analytics Cloud by Josef Hampp and Jan Lang.

Recommendation

Application Development with SAP Analytics Cloud
Application Development with SAP Analytics Cloud

Ready to make the most of your SAP Analytics Cloud applications? Learn to develop, deploy, and monitor custom analytical applications with this practical scripting guide! Follow step-by-step instructions and programming examples for each stage of development. Customize your dashboards and applications with widgets and APIs, and then adapt them to the needs of your users, whether you’re developing planning or business intelligence applications. This is your complete handbook to scripting in SAP Analytics Cloud!

Learn More
SAP PRESS
by SAP PRESS

SAP PRESS is the world's leading SAP publisher, with books on ABAP, SAP S/4HANA, SAP IBP, intelligent technologies, SAP Business Technology Platform, and more!

Comments