Professional Documents
Culture Documents
Monalisa Biswal
more by this author
SAP HANA
Database
share
0 share
0 tweet share
0
Follow
1 of 7 04/02/2018, 8:51 PM
Transposing Rows to Columns using Calculation view | SAP Blogs https://blogs.sap.com/2014/09/10/transposing-rows-to-columns-using-cal...
There are many nice articles available on hana modeling which talk about
In this article we will see how to transpose data from rows to columns.
Before going into the technical details, let’s take a case study.
e.g.
2 2 1
1 3 1
Create an analytic view and map all fields from the database table in
the output.
2 of 7 04/02/2018, 8:51 PM
Transposing Rows to Columns using Calculation view | SAP Blogs https://blogs.sap.com/2014/09/10/transposing-rows-to-columns-using-cal...
4 Comments
You must be Logged on to comment or reply to a post.
3 of 7 04/02/2018, 8:51 PM
Transposing Rows to Columns using Calculation view | SAP Blogs https://blogs.sap.com/2014/09/10/transposing-rows-to-columns-using-cal...
After activating the analytic view we can see its data in data preview
as below:
4 of 7 04/02/2018, 8:51 PM
Transposing Rows to Columns using Calculation view | SAP Blogs https://blogs.sap.com/2014/09/10/transposing-rows-to-columns-using-cal...
Now in the script we will need to write queries to populate the target
resultset.
For each of the new column in the resultset we will write a separate
query to fetch corresponsing information.
Since the analytic view doesn’t have these three columns we will use
5 of 7 04/02/2018, 8:51 PM
Transposing Rows to Columns using Calculation view | SAP Blogs https://blogs.sap.com/2014/09/10/transposing-rows-to-columns-using-cal...
Please see below the outputs of the queries and how they will merge
into final output.
6 of 7 04/02/2018, 8:51 PM
Transposing Rows to Columns using Calculation view | SAP Blogs https://blogs.sap.com/2014/09/10/transposing-rows-to-columns-using-cal...
After activating the calculation view, you will be able to see data in the
transposed format.
Alert Moderator
7 of 7 04/02/2018, 8:51 PM