Symptom
After using the addDimensionToRows function to add several row dimensions, the display order of row dimensions is not as expected.
Environment
SAP Analytics Cloud
Reproducing the Issue
- Open a story that contains a table.
- Run a script that retains a subset of existing row dimensions, then iterates over a list and calls Table.addDimensionToRows() to add additional row dimensions.
- Observe that the row dimension order are not the same as the list.
Cause
If a dimension already exists in the row axis, calling Table.addDimensionToRows does not re-add or reposition it; the dimension stays in its original location.
Resolution
- Modify the script to remove all row dimensions from the table before adding any new ones (avoid retaining a subset during reconfiguration).
- Add the row dimensions back in the exact desired sequence using Table.addDimensionToRows() for each dimension.
- After the final row order is set, resume refresh and re-enable planning only if required by the application logic.
- Validate the result by comparing with the order produced via the standard Builder panel to ensure the scripted order matches expectations.
See Also
Keywords
SAC, unified story, script, addDimensionToRows, dimension order, rows/columns settings, table API, row dimensions, removeDimension, onInitialization, planning table, story table, ordering, scripting, builder panel , KBA , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem
Product
SAP Analytics Cloud 1.0
SAP Knowledge Base Article - Public