There doesn’t seem to be a native function in InfluxDB that does that but I want to apply this simple feature scaling formula on a a measurements field values
x - min_x / max_x - min_x
I am trying to create a query like
select (sum(field_name) - min_grouped_sums) / (max_grouped_sums - min_grouped_sums) from "measurement" where time = now - 10d group by time(100s),"tag_name"
I can get the min and max values of these groups using
select min(*) from (SELECT sum("field_name") as count FROM "measurement" WHERE time = now - 10d group by time(100s),"tag_name" fill(null)) GROUP BY "tag_name"
and
select max(*) from (SELECT sum("field_name") as count FROM "measurement" WHERE time = now - 10d group by time(100s),"tag_name" fill(null)) GROUP BY "tag_name"
but I cannot compose a query that can combine both