Hello, fellows.
I’m new to InfluxDB and I’d like to get a maximum value in the point. I think it must be very simple, but, since InfluxDB’s MAX() function does not take multiple fields, I don’t know how to get a result I want.
My measurement looks like this:
{
time: <timestamp>,
tags: {
station: <station-code>,
},
fields: {
e-componet: <value>,
n-componet: <value>,
z-componet: <value>,
}
}
Let’s say these are my data:
time station e-componet n-componet z-componet
------------------------------------------------------------
2019-08-14T00:20:00Z A -10 10.9 -11.8
2019-08-14T00:10:00Z A -9.9 10.8 -10.8
2019-08-14T00:00:00Z A -9.8 10.7 -10.8
2019-08-13T23:50:00Z A -9.8 10.7 -10.8
2019-08-13T23:40:00Z A -9.7 10.6 -10.4
2019-08-13T23:30:00Z A -9.7 10.5 -10.4
2019-08-13T23:20:00Z A -9.5 10.5 -10.3
2019-08-13T23:10:00Z A -9.4 10.4 -10.3
And I’d like to get a result like this:
time station MAX(ABS(e-componet), ABS(n-componet), ABS(z-componet))
-------------------------------------------
2019-08-14T00:20:00Z A 11.8
2019-08-14T00:10:00Z A 10.8
2019-08-14T00:00:00Z A 10.8
2019-08-13T23:50:00Z A 10.8
2019-08-13T23:40:00Z A 10.6
2019-08-13T23:30:00Z A 10.5
2019-08-13T23:20:00Z A 10.5
2019-08-13T23:10:00Z A 10.4
I’ve tried several queries, but, I couldn’t get the desired result.
Any comments will be welcome.