I'm usually a MySQL guy, so excuse and please correct me if I'm using the 
wrong expressions for something here.

I recently migrated to influxDB to store measurement data from a home 
automation system called "OpenHAB". A typical measurement/table would look 
like this:

+---------------------+-------+
| time                | value |
+---------------------+-------+
| 2016-10-31 22:00:00 |  11.1 |
| 2016-10-31 22:07:08 |  10.8 |
| 2016-10-31 22:20:02 |  10.8 |
| 2016-10-31 22:30:28 |  10.8 |
| 2016-10-31 22:39:29 |  10.8 |
| 2016-10-31 22:44:04 |  10.8 |
| 2016-10-31 22:49:02 |  10.5 |
| 2016-10-31 23:00:00 |  10.5 |
| 2016-10-31 23:42:02 |    10 |
| 2016-11-01 00:00:00 |    10 |
| 2016-11-01 00:30:02 |   9.5 |
| 2016-11-01 01:00:00 |   9.5 |
| 2016-11-01 01:11:02 |   9.3 |
| 2016-11-01 01:22:02 |   9.1 |

The value type can be either float or string.

What I want to do now is to delete every datapoint with the same value that 
occurred consecutively in a row, but always keep the first and the last 
one. So after the filtering process the ideal measurement would look like 
this:

+---------------------+-------+
| time                | value |
+---------------------+-------+
| 2016-10-31 22:00:00 |  11.1 |
| 2016-10-31 22:07:08 |  10.8 | <-- only here
| 2016-10-31 22:44:04 |  10.8 |
| 2016-10-31 22:49:02 |  10.5 |
| 2016-10-31 23:00:00 |  10.5 |
| 2016-10-31 23:42:02 |    10 |
| 2016-11-01 00:00:00 |    10 |
| 2016-11-01 00:30:02 |   9.5 |
| 2016-11-01 01:00:00 |   9.5 |
| 2016-11-01 01:11:02 |   9.3 |
| 2016-11-01 01:22:02 |   9.1 |


This has a simple background:
- I don't want to delete any information since it can be valuable for 
future optimization processes (e.g. calculating thermal resistances)
- Tough I still want to save storage space and optimize graphing processes 
by deleting redundant information
- The first and the last point of a measurement indicates that the value 
stayed on the same level in between when looking at the data via Grafana 
etc. 

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/a10c37f3-3cfa-4c35-8230-4f6570392715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to