Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
avgIf
Description
TheIf combinator can be applied to the avg
function to calculate the arithmetic mean of values for rows where the condition is true,
using the avgIf aggregate combinator function.
Example usage
In this example, we’ll create a table that stores sales data with success flags, and we’ll useavgIf to calculate the average sale amount for successful transactions.
Query
avgIf function will calculate the average amount only for rows where is_successful = 1.
In this case, it will average the amounts: 100.50, 200.75, 300.00, and 175.25.
Response