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
- Log in to SAP Analytics Cloud.
- Open the specified story.
- Run a script that calls the function Table.getDataSource().getResultMember() and calculate the time.
- Run this script again and calculate the time of function Table.getDataSource().getResultMember().
- 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
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