Creating percentile_cont as aggregate function in Vertica
I need an aggregate function for percentile_cont() in Vertica. However, only analytic function for it is available in this database. Is it possible to create one using stored procedure or something? Will really appreciate any advice and steps to construct this. Ideally, it should work like Oracle's aggregate percentile_cont() as shown in this link. Thank you.
You can use an Analytical function still if you want to and just inline view or use with. As long as the grouping is the same as your partition, the pc_value will always be the same for that group level (as in, safe to group on). select g1, g2, pc_value, sum(value) sum_value from ( select g1, g2, value, PERCENTILE_CONT(.5) WITHIN GROUP(ORDER BY value) OVER (PARTITION BY g1, g2) ) x group by g1, g2, pc_value You can try to create a UDX (although it won't look exactly like this because of the language construct, so you'd probably create a function with two parameters)... but I really don't think it'll perform better and this isn't too unreadable.
Complexity asymptotic relation (theta, Big O, little o, Big Omega, little omega) between functions
What are TOP_COUNT and TOP_MAXCOUNT in BigQuery?
marklogic need advise for approach to aggregate documents
multiply(num) aggregate function in postgresql
Binding the Result of an Aggregate Function to a Projected Variable
tableau aggregate data based on dimension
where clause and aggregate functions
Is there such a thing as a join() aggregate function that concatentates field values at a specific character?
Aggregation of an expression in Django query spanning multiple tables
How to aggregate / roll up percentile measures
A peer-to-peer and privacy-aware data mining/aggregation algorithm: is it possible?
Multiple aggregates in SPARQL
SAP BO XI Desktop Intelligence Aggregate Calculations
Mondrian: Help picking the right aggregator for Measures?
Subtract 2 measures as Grand Total in SSAS Cube Browser
Non-aggregated measure in OLAP cube