on 12-06-2023 3:12 PM
I am trying to unpivot some data in SAP Datasphere. SAP SQL won't accept the UNPIVOT function, but native HANA does allow the SERIES_GENERATE_INTEGER. Even when I use a 3rd party DB Manager (DBeaver) and use SQL statement on Datasphere content, it works. However then applying that SQL in a SQL View to generate a new unpivotted view faiils with error
Mismatched ‹Number›, expecting ‹Identifier›
It's unclear if it's a different syntax Datasphere needs or simply SERIES_GENERATE_INTEGER is not in their library.
If the latter, how can I unpivot data in Datapshere without resorting to Python or going under the hood into a stored proceedure?
Many thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answers, that has worked!
Interestingly as I was unable to get this working initially, I went about unpivotting an alternative way. I used a UNION of the table multiple times for each individual field I wanted to unpivot.
I have now built same view but using series generate integer.
I have now compared performance of both methods and interestingly the UNION (40 times!) is much more performant than the series generate integer.
I'm just commenting here on my findings in case anyone looks at this question for their own answers to UNPIVOT in SAP Datasphere, in my case, the UNION method is far more efficient, so worth trying out both if anyone has similar use case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
8 | |
7 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.