Forum

This content is now out of date.

Visit Our Community

text aggregate function?

I am summing a lot metrics, but I have one dimension that differs between rows, so I would like to just aggregate that dimension by concatenating the text. PostgreSQL & Oracle provide the string_agg() aggregate function, but I would like to avoid creating a whole view just to use it.

Does yellowfin have the ability specify the usage of other aggregate functions that the database supports?
Hi Edwin,

yes Yellowfin can do that. If you would like to use the string_agg() function at the report level without having to add a Freehand SQL calculated field at the view level you would have to create a Custom Function as described in this forum post.. Once having done that then the string_agg function will be available in a report-level calculated field.

To save you some time I have prepared the function to be pasted into your custom-functions file:
[code]


String Agg, Postgresql

1
StringAgg
text



string_agg($1, ',')


string_agg($1, ',')
Postgresql
text

[/code]

I hope that works out for you, if there are any issues or questions then please don't hesitate to let us know.

Regards,
Dave