BigQuery
Window13 fungsi

Fungsi Window BigQuery

Fungsi analitik untuk perhitungan berbasis baris. Temukan semua 13 fungsi window di BigQuery lengkap dengan syntax, contoh, dan penjelasan bahasa Indonesia.

13 fungsi window di BigQuery

← Semua fungsi BigQuery

CUME_DIST

Window

Menghitung cumulative distribution - proporsi baris dengan nilai kurang dari atau sama dengan baris saat ini.

Tipe hasil: FLOAT64

DENSE_RANK

Window

Memberikan peringkat untuk setiap baris tanpa gap. Baris dengan nilai sama mendapat peringkat sama, peringkat berikutnya langsung +1.

Tipe hasil: INT64

FIRST_VALUE

Window

Returns the first value in the window frame for each row.

Tipe hasil: Same as input expression

LAG

Window

Accesses a value from a previous row in the partition based on the specified offset.

Tipe hasil: Same as input expression

LAST_VALUE

Window

Returns the last value in the window frame for each row.

Tipe hasil: Same as input expression

LEAD

Window

Accesses a value from a subsequent row in the partition based on the specified offset.

Tipe hasil: Same as input expression

NTH_VALUE

Window

Returns the value at the Nth position in the window frame.

Tipe hasil: Same as input expression

NTILE

Window

Divides rows within a partition into a specified number of buckets and assigns a bucket number to each row.

Tipe hasil: INT64

PERCENTILE_CONT

Window

Computes a continuous percentile value using linear interpolation across the values in a group.

Tipe hasil: FLOAT64

PERCENTILE_DISC

Window

Returns the actual value at the nearest percentile without interpolation.

Tipe hasil: Same as input expression

PERCENT_RANK

Window

Menghitung percentile rank relatif dari setiap baris. Nilai antara 0 dan 1, menunjukkan persentase baris yang lebih rendah.

Tipe hasil: FLOAT64

RANK

Window

Assigns a rank to each row. Rows with equal values receive the same rank, and there is a gap after ties.

Tipe hasil: INT64

ROW_NUMBER

Window

Assigns a unique sequential number to each row within a partition, starting at 1. No duplicate values are assigned.

Tipe hasil: INT64