DB pivot - Manual aggregation - FIRST

Hallo everyone,
I am trying to use DB pivot for a table and would like to use manual aggregation method “FIRST” for a column. But it seems like there is no option available for this method with DB pivott :frowning:

I saw there is an option “custom” to customize aggregation method but not sure how to do so.

Could you please give me some hints for it.
Thank you so much

Hi Hanh,

the configuration window is pretty straight forward: replace “FUNCTION” with whatever aggregation function you want to apply.

However, it seems that selecting the first row as aggregation function is something that isn’t supported, i.e. there is no “FIRST” function for group by or pivoting aggregations. There are workarounds using e.g. subqueries and windowing functions, though that requires quite some SQL knowledge.
If you want to go down that rabbit hole and edit the SQL query issued, you can use the DB Query Extractor node to access the query.

Kind regards

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.