# Aggregation Functions

Contrary to detection pipeline, RCA algorithms have a limited set of aggregation functions available.

If the metric used for RCA is onboarded in ThirdEye, a default aggregation function is available.

If the metric is a derived metric or is not onboarded in ThirdEye, the aggregation function should be set in the alert configuration aggregationFunction field.

## Available aggregation functions

name | description |
---|---|

`SUM` | Sum of the metric |

`AVG` | Average of the metric |

`COUNT` | Count of the lines |

`COUNT_DISTINCT` | Distinct count of the lines |

`MAX` | Maximum of the metric |

`MIN` | Minimum of the metric |

`PCT50` | 50th percentile of the metric |

`PCT90` | 90th percentile of the metric |

`PCT95` | 95th percentile of the metric |

`PCT99` | 99th percentile of the metric |

See source code.

## Datasource compatibility

Some datasources may not be compatible with all aggregation functions.

#### Compatibility matrix

function | Pinot |
---|---|

`SUM` | YES |

`AVG` | YES |

`COUNT` | YES |

`COUNT_DISTINCT` | YES |

`MAX` | YES |

`MIN` | YES |

`PCT50` | YES |

`PCT90` | YES |

`PCT95` | YES |

`PCT99` | YES |