SAP Knowledge Base Article - Public

3391469 - The result is sorted by "Descriptoin" when using scripts to add a new dimension to a table


In optimized story or application, for table with BW model, when using scripts to add a new dimension (the display mode is 'id and description') to rows and sort by it, the result is sorted by 'description'.


SAP Analytics Cloud 1.0

Reproducing the Issue

1,Create an optimized story or an application for testing.

2,Add a table with BW model.

3,Add a button and add below scripts to the button's onClick event. Make sure that the display mode of the newly added dimension is 'id and descrption':


Table_1.sortByMember("0BC_CUST", SortOrder.Descending);

4,Save the story or the application and run it.
5. Click on the button and check the console log and the sorting result.

The member display mode in console log is 'Description' instead of 'DisplayIdAndDescription'. The '0BC_CUST' dimension rows are sorted by description instead of id and description.


The dimension is added before sorting, and the scripts are in one event. Although the dimension has been added, for Table.sortByMember API, it cannot get the display mode of the dimension. Then it is sorted by 'Description' defaultly.



  • A workaround  is available. Please change the script as below:

Application.setRefreshPaused([Table_1.getDataSource()], false);
Table_1.sortByMember("0BC_CUST", SortOrder.Descending);

  • Our development team are investigating a fix for the issue. Due to a technical restriction, the fix won't be available soon. Once the fix schedule is defined, this KBA will be updated.


KBA , LOD-ANA-UNS-DVP , Unified Story Developer Issues , LOD-ANA-AD , Analytics Designer , Problem


SAP Analytics Cloud 1.0