Skip to content
Advertisement

How to get increment number when there are any change in a column in Bigquery?

I have data date, id, and flag on this table. How I can get the value column where this column is incremental number and reset from 1 when there are any change in flag column?

my table

Advertisement

Answer

Consider below approach

if applied to sample data in your question – output is

enter image description here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement