Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Aggregation in CDS View

Former Member
0 Kudos

Hello All,

I have a requirement for aggregation

Field 1 Field2 Field3

1 A 10

1 A 20

1 B 30

1 B 10

1 C 20

2 B 10

2 C 10

2 C 20

2 D 10

2 D 30

3 A 40

3 C 10

3 D 20

3 D 20

I want output as

Field1 sumA sumB sumC sumD

1 30 40 20 0

2 0 10 20 40

3 40 0 10 40

I can write aggregation by grouping FIELD1 and FIELD2, which would give me

the sum.

Field1 Field2 SUM

1 A 30

1 B 40

1 C 20

2 B 10

2 C 20

2 D 40

3 A 40

3 C 10

3 D 40

But I need to manipulate the result to get in to above mentioned format.

Is there a way I can achieve this in a CDS view.

With regards,

Sandeep Akella

0 REPLIES 0