---
name: Aggregation
lang: cpp
domain: core
version: "1.0.0"
algebraic: product
definition: |
  struct Aggregation {
      AggFn       fn;
      std::string col;
      double      arg;
      std::string alias;
  };
description: "Funcion de agregacion en Stage 1+. fn = Count/Sum/Avg/Min/Max/Distinct/Stddev/Median/P25/P75/P90/P99/Percentile. arg = parametro (p para percentile)."
tags: [tql, aggregation, agg, product-type]
uses_types: []
file_path: "cpp/functions/core/data_table_types.h"
---

## Notas

`alias` vacio dispara `aggregation_alias(a)` auto: `count`, `sum_<col>`, `distinct_<col>`, `p95_<col>` etc. SQL mapping en `tql_to_sql`: `COUNT(*)`, `SUM("col")`, `quantile_cont("col", p)`.
