Fungsi Aggregate BigQuery
Fungsi untuk menghitung nilai dari kumpulan data. Temukan semua 28 fungsi aggregate di BigQuery lengkap dengan syntax, contoh, dan penjelasan bahasa Indonesia.
28 fungsi aggregate di BigQuery
← Semua fungsi BigQueryANY_VALUE
Returns one value from a group non-deterministically. Useful for retrieving a value from a column that is not being aggregated when all values in the group are the same.
Same as input typeAPPROX_COUNT_DISTINCT
Estimates the number of distinct values using the HyperLogLog++ algorithm. Much faster and less resource-intensive than COUNT(DISTINCT) for large datasets.
INT64APPROX_QUANTILES
Calculates approximate quantile boundaries from numeric data. Uses an efficient approximate algorithm for large datasets, returning an array with n+1 elements.
ARRAY<T>APPROX_TOP_COUNT
Returns the approximate most frequently occurring elements along with their counts. Uses a highly efficient approximate algorithm for large datasets.
ARRAY<STRUCT<value T, count INT64>>APPROX_TOP_SUM
Returns the approximate elements with the highest total weight. Similar to APPROX_TOP_COUNT but ranked by sum of weights rather than count.
ARRAY<STRUCT<value T, sum INT64>>ARRAY_AGG
Collects values from multiple rows into an ARRAY. A powerful BigQuery function for building nested data structures.
ARRAY<T>ARRAY_CONCAT_AGG
Concatenates multiple arrays into a single array. Useful when each row already contains an array and you want to merge them all into one.
ARRAY<T>AVG
Calculates the average (mean) of numeric values in a column. Ignores NULL values and supports multiple numeric types in BigQuery.
FLOAT64BIT_AND
Performs a bitwise AND operation across all values in a group. Returns a value where each bit is 1 only if all input values have that bit set to 1.
INT64BIT_OR
Performs a bitwise OR operation across all values in a group. Returns a value where each bit is 1 if at least one input value has that bit set to 1.
INT64BIT_XOR
Performs a bitwise XOR operation across all values in a group. Returns a value where each bit is 1 if the number of input values with that bit set to 1 is odd.
INT64CORR
Menghitung koefisien korelasi Pearson antara dua kolom numerik.
FLOAT64COUNT
Counts the number of rows or non-NULL values in a column. A fundamental aggregate function in BigQuery for large-scale data analysis.
INT64COUNTIF
Counts the number of rows that satisfy a given condition. Provides a more concise and readable syntax compared to COUNT with CASE or IF.
INT64COVAR_POP
Menghitung kovarians populasi antara dua kolom numerik.
FLOAT64COVAR_SAMP
Menghitung kovarians sample antara dua kolom numerik.
FLOAT64LOGICAL_AND
Returns TRUE if ALL values in the group are TRUE. Acts as an aggregated AND operator, useful for verifying that every condition in a set is met.
BOOLLOGICAL_OR
Returns TRUE if AT LEAST ONE value in the group is TRUE. Acts as an aggregated OR operator, useful for checking whether any condition in a set is met.
BOOLMAX
Returns the maximum value from a column or expression. Supports numeric, string, date/time, and boolean types in BigQuery.
Same as input typeMIN
Returns the minimum value from a column or expression. Supports numeric, string, date/time, and boolean types in BigQuery.
Same as input typeSTDDEV
Calculates the sample standard deviation of numeric values. Measures how spread out the data is from its mean. An alias for STDDEV_SAMP.
FLOAT64STDDEV_POP
Calculates the population standard deviation of numeric values. Uses the N divisor formula (not N-1), suitable when the data represents an entire population.
FLOAT64STDDEV_SAMP
Calculates the sample standard deviation of numeric values. Uses the N-1 divisor formula (Bessel's correction), suitable for sample data that represents a larger population.
FLOAT64STRING_AGG
Concatenates string values from multiple rows into a single string with a specified delimiter. Very useful for creating lists or comma-separated values in BigQuery.
STRINGSUM
Calculates the total sum of numeric values in a column. Supports multiple numeric types and is highly efficient for large-scale data analysis in BigQuery.
Same as input type (INT64, FLOAT64, NUMERIC, or BIGNUMERIC)VARIANCE
Calculates the sample variance of numeric values. Variance is the square of the standard deviation. This is an alias for VAR_SAMP.
FLOAT64VAR_POP
Calculates the population variance of numeric values. Uses the N divisor formula, suitable when the data represents an entire population.
FLOAT64VAR_SAMP
Calculates the sample variance of numeric values. Uses the N-1 divisor formula (Bessel's correction), suitable for sample data.
FLOAT64