06-28-2017 11:56 AM
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