Suppose I have some raw data which has larger gaps in their.
I can easily ssue a query and let Influx fill missing values like so:
SELECT MEAN(value) AS c1 FROM SampleMeasurement WHERE time > '2017-11-01T00:00:00Z' GROUP BY time(1h) fill(linear)
I will get a result like this:
time c1
---- --
2017-11-01T00:00:00Z
2017-11-01T00:01:00Z 0
2017-11-01T00:02:00Z 3
2017-11-01T00:03:00Z 6
2017-11-01T00:04:00Z 10
2017-11-01T00:05:00Z 20
2017-11-01T00:06:00Z 23
In the application which processes the query, I’d like to know whether a point was filled or “real”. (I want to mark those points red in a graph for the user later on). So ideally, I’d like to get a result like this:
time c1 status
---- -- ------
2017-11-01T00:00:00Z MISS
2017-11-01T00:01:00Z 0 TRUE
2017-11-01T00:02:00Z 3 INTERPOLATED
2017-11-01T00:03:00Z 6 TRUE
2017-11-01T00:04:00Z 10 TRUE
2017-11-01T00:05:00Z 20 TRUE
2017-11-01T00:06:00Z 23 TRUE
Apart from the missing first value, how could I actually do this? I tried to formulate an INNER JOIN where I wanted to once us fill(linear)
and once use fill(-1)
because -1
can’t appear in my data and would thus indicate an invalid status, but didn’t get that query working.
Has anyone an idea?
Best regards
Theo