You might want to include the case-condition columns in the group by clause instead of the columns you use for the case-condition columns.
Grouping is done in reference to the output of the query (the projection list).
Also, not sure whether this is handled automatically in ABAP CDS or not, I don't see a MANDT/CLIENT field in the selection/join condition. If ABAP CDS doesn't handle this for you, this could be a reason for data duplication.
- Lars