Skip to main content

Description

The If combinator can be applied to the count function to count the number of rows where the condition is true, using the countIf aggregate combinator function.

Example usage

In this example, we’ll create a table that stores user login attempts, and we’ll use countIf to count the number of successful logins.
Query
The countIf function will count only the rows where is_successful = 1 for each user.
Response

See also

Last modified on July 2, 2026