Using Filtered Aggregates
ClickHouse provides a simple and intuitive way to write filtered aggregates. For example, compare the standard SQL way to write filtered aggregates (which work fine in ClickHouse) with the shorthand syntax using the-If aggregate function combinator, which can be appended to any aggregate function:
-Distinct aggregate combinator: