SAP Knowledge Base Article - Public

3247749 - Error when using Windows functions in SQL in SAP Datasphere

Symptom

Getting error when creating SQL View using window functions.

Environment

SAP Datasphere

Reproducing the Issue

  1. Log into SAP Datasphere
  2. Try to create a SQL view with SQL for example:
    SELECT ProdName, Type, Sales,
      ROW_NUMBER() OVER (PARTITION BY ProdName ORDER BY Sales DESC) AS row_num
    FROM ProductSales
    ORDER BY ProdName, Sales DESC;
  3. Error when previewing data

Cause

SAP Datasphere does not support SAP HANA Cloud "window functions"

Resolution

Working sa designed. Currently, SQL window functions aren't supported in the SQL View in SAP Datasphere.
See  SQL Functions Reference | SAP Help Portal

If possible, change the SQL view language to "SQLScript(Table Function)", see SAP Help Page.
Window functions can be leveraged with an additional change in syntax:

image.png

Keywords

dwc, data warehouse cloud , KBA , DS-MD-VIW , Views , Problem

Product

SAP Datasphere all versions