The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

# Custom multi-argument aggregate functions

I have a custom aggregate metric that is computed based on two different columns. It can be computed in SQL, but it is moderately complex. Something similar to: 100 * SUM(CASE WHEN c1 IN (0,1,2) THEN 1 ELSE 0) / SUM(CASE WHEN c1 = 0 AND c2 = 1 THEN 1 ELSE 0) I would like to abstract this into a UDF so that we can tweak the formula periodically and not have to update every query separately. Is there a clean way to do this, given that UDAFs can only take a single argument?

0

## Leave a Comment

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.

## Comments