STRING_AGG is the used to show the multiple
row data into single row by concatenate with Given Value
Ex: We have the Data like in the following.
By Using the STRING_AGG function with concatenate with ‘;’. we can
get the following output.
Mainly we
have two main Steps
1. Creation of Tables
(Using CDS) & Insert of data.
2.
How to use the String_Agg Function in
Calculation view by using the created tables.
Step By
Step Process for the above Mention Points
1. Creation of Tables
(Using CDS) & Insert of data.
Step
-1: Open
the Perspective as SAP HANA Development as shown in the below screenshot.
Step-2: Right click on System in Repositories and select the Import Remote Workspace as shown in the below screenshot.
Step-4: Right Click on Package and select New and in the Select Others as shown in the below screenshot.
Step-5: Select the DDL Source File and Click on Next as shown in the below
screenshot.
Step-6: Select the Package and Click on Next as shown in the below screenshot.
Step-6: Select the Package and Click on Next as shown in the below screenshot.
Step-13: Right click on table
Emp_Details and select Generate Insert Statement as shown in the below screenshot.
Step-18: Right click on table
Emp_Salary_Details and select Generate Insert Statement as shown in the below screenshot.
2.
How to use the String_Agg Function in
Calculation view by using the created tables.
Step-1: Right Click on Package and
select the Calculation View as shown in the below screenshot.
Step-2: Select Calculation View Type
as SQL Script as shown in the below screenshot.
Step-3: After Click on Finish Below screen
will come .
Step-4: In the Details Screen we have
to write the following script (We required the total Salary with All Months in
the single Cell).
Step-5: Activate by
clicking on the Activate .
Step-6: Calculation View is successfully
Activated as shown in the below screenshot.
Step-7: For Seeing the Output of the
View select Open in Data preview Editor as shown in the below screenshot.
Step-8: Output of the view (Actually
No of Row of data is there we are showing the data in the single row by using the
String_Agg Function on the Repeated Value)
Comments
Post a Comment