The goal is to create the time series normalized on the first value of the time frame. For example, we have the series
time | value
------------------------------
2020-07-13T00:00:00Z | 2
2020-07-14T00:00:00Z | 4
2020-07-15T00:00:00Z | 3
and want to get the result
time | value
------------------------------
2020-07-13T00:00:00Z | 1
2020-07-14T00:00:00Z | 2
2020-07-15T00:00:00Z | 1.5
I have tried the following query:
select "value" / first_value from (select "value" from "database"."autogen"."measurement"), (select first("value") as first_value from "database"."autogen"."measurement")
but it produces empty time series.
Could somebody explain me where is the mistake?