TOKEN "interpolating_gaps_endpoint_read_0406" READ NODE raw SQL > SELECT *, bar(value, 0, 100, 20) as value_bar FROM trends_with_gaps ORDER BY date WITH FILL STEP 1 NODE interpolation SQL > SELECT groupArray(date) dt_arr, groupArray(value) value_arr, arrayFill(x -> x.1 > 0, arrayZip(value_arr, dt_arr)) value_lower, arrayReverseFill(x -> x.1 > 0, arrayZip(value_arr, dt_arr)) value_upper, arrayMap((l, u, v, dt) -> if(v > 0, v, l.1 + ((u.1 - l.1) / (u.2 - l.2) * (dt - l.2)) ), value_lower, value_upper, value_arr, dt_arr) AS value_interpolated FROM trends_with_gaps NODE result SQL > SELECT date, value, value_interpolated, bar(value_interpolated, 0, 100, 20) as value_interpolated_bar FROM interpolation ARRAY JOIN dt_arr AS date, value_interpolated, value_arr AS value