Skip to content
Advertisement

How to fill irregularly missing values with linear interepolation in BigQuery?

I have data which has missing values irregulaly, and I’d like to convert it with a certain interval with liner interpolation using BigQuery Standard SQL.

Specifically, I have data like this:

and I’d like to convert this table as follows:

Any smart soluton for this?

Supplement: this question is similar to this question in stackoverflow but different in that the data is missing irregulaly.

Thank you.

Advertisement

Answer

Below is for BigQuery Standard SQL

if to apply to sample data from your question – output is

enter image description here

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