Symptom
You open an Analytic Application and the message “Script execution failed for event "XXX" pops on the bottom of the screen.
The same message may also be seen after Table’s/Chart’s “onResultChanged” has been triggered.
In the browser's console you can see the following:
Invalid 0 alias @NullMember
Error: Invalid 0 alias @NullMember
at a (assets.sapanalyticscloud.cn/production/uiAssets-2020.18.0/uiAssets/app.chunk.714.slice_of_appBuilding-chunk.3487441a83c5f8083735.js:38)
at assets.sapanalyticscloud.cn/production/uiAssets-2020.18.0/uiAssets/app.chunk.714.slice_of_appBuilding-chunk.3487441a83c5f8083735.js:38
at Object.t.resolve (assets.sapanalyticscloud.cn/production/uiAssets-2020.18.0/uiAssets/app.chunk.714.slice_of_appBuilding-chunk.3487441a83c5f8083735.js:38)
Environment
SAP Analytics Cloud;
Reproducing the Issue
- Open an SAC Application;
- Script execution failed for event "XXX" pops on the bottom of the screen;
or
- You trigger a "onResultChanged" script;
- Script execution failed for event "XXX" pops on the bottom of the screen;
(The same may happen with other scripting event);
Cause
This happens because the NULL members from an specific dimension or measure are not being handled correctly. From version 2020.11 of SAC, new scripting enhancements were introduced to handle both NULL members and Total Members.
Resolution
The enhanced API's list can be found in the help page NULL Members and Totals Members in Scripting APIs.
As an example, we can use an if statement to check for NULL members and treat them accordingly to our Scripting needs. We can use the API getResultSet();
which allows to specify Alias.NullMember in the selection.
The scenario would be like the following:
var check = Chart_1.getDataSource().getResultSet("<Dimension>");
for (var i=0; i<check.length; i++){
if (check[i]["<Dimension>"].id === Alias.NullMember){
<block of statement>;
}
}
Please note that the aforementioned script must be adapted according to your business requirements.
See Also
Keywords
@NullMember, Invalid, 0, alias, NullMember, Live, Import, connection, BW, HANA, application, analysis, APIs, components, script. , KBA , LOD-ANA-AD-COR , SAC Application Designer , LOD-ANA-AD , Analytics Designer , Product Enhancement