0

I am trying to use a STRING_AGG function in my SAP HANA CDS file, but the system does not seem to recognize this function. Standard aggregation functions like sum or count seems to work but this one - doesn't:

view MY_VIEW as
    select from A_TABLE A
    left join B_TABLE as B on
        A.ID = B.REF_ID
    {
        count( * ) as DATA,
        STRING_AGG(B.CODE,', ') CODES
    }
    group by OTHER_ID;

Is there a way to use this function within SAP HANA CDS files? Or is there a workaround?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
zygimantus
  • 3,649
  • 4
  • 39
  • 54

1 Answers1

2

SAP HANA Core Data Service (CDS) views don't support the complete set of aggregation functions that are available with SAP HANA SQL. See the documentation for details on that.

A potential workaround can be to create SQL views with the desired aggregations and reference those views in CDS views.

Lars Br.
  • 9,949
  • 2
  • 15
  • 29