SAP Knowledge Base Article - Public

3578893 - Slow Performance with function Table.getDataSource().getResultMember() during the first time in SAP Analytics Cloud (SAC)

Symptom

  • The function Table.getDataSource().getResultMember() exhibits slow performance during the first time call in a session.
  • The later call is much faster than the first time.

Environment

SAP Analytics Cloud

Reproducing the Issue

  1. Log in to SAP Analytics Cloud.
  2. Open the specified story.
  3. Run a script that calls the function Table.getDataSource().getResultMember() and calculate the time.
  4. Run this script again and calculate the time of function Table.getDataSource().getResultMember().
  5. The consumed time of step 3 is much slower than step 4.

Cause

When the table is rendered in the SAC story, it does not process all data. It only processes the cells in the 'viewport' first.

However, once SAC calls getResultMember(), the system needs to iterate through all the cells to match the input context, and it has to wait for all cells to be processed completely. This takes a lot of time for a large table. However, the second call will be fast because all cells are rendered by the first call. 

Resolution

The performance difference works as designed.

In some cases, the function getResultMember() is not necessary. For example,

  • original: Table_1.getDataSource().getResultMember("Week",selections)
  • new: Table_1.getSelections()[0].Week

See Also

Optimized Story Experience API Reference Guide

Keywords

SAP Analytics Cloud, JavaScript function, getDataSource(), performance issue, first session call, execution time, troubleshooting, API, getResultMember, getResultMember(), getSelections , KBA , LOD-ANA-AD-INF , Analytics Designer Infrastructure , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem

Product

SAP Analytics Cloud all versions