Symptom
- Script-based ranking using rankBy() does not produce the same result as manual ranking applied via the table context menu.
- Manual ranking behaves as expected when using Top N, Based On a measure, and Ranked By all dimensions individually.
- The issue occurs when the underlying BW query contains multiple structures.
- When the BW query contains a single structure, both manual ranking and rankBy() work as expected.
Environment
SAP Analytics Cloud Version 2026.08.15
Reproducing the Issue
- Add a table based on a BW live model whose query contains two structures.
- In the table, apply a manual ranking from the context menu (Right-click > Rank), choose Top N based on a measure, and apply. Observe that the ranking is applied correctly.
- Remove the manual ranking from the same table.
- Run a script that calls Table.rankBy() to apply the same Top N ranking criteria as in step 2.
- Observe that the scripted ranking does not apply.
- In the same story, use another table based on a BW query with a single structure and run the same rankBy() script.
- Observe that the ranking is applied correctly in the single-structure scenario.
Cause
When a table is based on a BW model that contains a dimension with multiple structures, or the linked dimensions contain multiple structures, the Table.rankBy() script API refuses to produce a rank.
Resolution
The fix is included in version 2026.8.16.
See Also
- Refer to: Scripting and API Restrictions
- Refer to: Write Scripts in Script Editor
- Refer to: Scripting Patterns and Examples
Keywords
rankBy, ranking, top n, analytics designer, table ranking, bw live connection, multiple structures, secondary structure, scripting, unified story, table api, rank discrepancy, bw query, rank behavior, script vs manual , KBA , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , LOD-ANA-TAB , Table , Problem
Product
SAP Analytics Cloud all versions
SAP Knowledge Base Article - Public