Symptom
hen running the data preview on a SQL view that contains an ORDER BY ASC or DESC clause, the result order is not changed.
Environment
SAP Datasphere
Reproducing the Issue
- Create a SQL view in Data Builder that selects a column and includes an ORDER BY clause on that column (for example, ORDER BY column_name DESC or ORDER BY column_name ASC).
- Open the Data Preview for the SQL view and observe that the displayed rows are not sorted according to the ORDER BY clause.
Cause
The Data Builder preview ignores ORDER BY clauses in SQL views by design; ORDER BY is applied when the view is consumed by applications or clients, not in the preview.
Resolution
- Verify the sort behavior by consuming the SQL view from an analytics client or SQL tool; the ORDER BY clause will be applied when the view is executed by consumers.
- To display sorted results during preview, use the preview's UI sort controls instead of relying on the ORDER BY clause in the SQL view.
- If a sorted preview based on SQL ORDER BY is required as a product capability, submit an enhancement request via the SAP Influence Portal for Datasphere.
See Also
Keywords
datasphere, data builder, sql view, data preview, order by ignored, sorting not applied, result order unchanged, asc, desc, view modeling, design limitation, preview sort, analytical consumption, sql order by, feature request , KBA , DS-DI-DM , Data Maintenance , DS-MD-VIW , Views , Problem
Product
SAP Datasphere all versions
SAP Knowledge Base Article - Public