I have a CSV file of the following format that I am trying to wrangle with GCP dataprep.
Timestamp Tag Value
2018-05-01 09:00:00 Temperature 40.1
2018-05-01 09:00:00 Humidity 80
2018-05-01 09:05:00 Temperature 40.2
2018-05-01 09:05:00 Humidity 80
2018-05-01 09:10:00 Temperature 40.0
2018-05-01 09:10:00 Humidity 82
The data extends in 5 minutes interval for 2 weeks. I would like to transform it such that at each 10 minute interval, I am displaying the average(or min/max/median) of the previous 10 minutes and also pivot it,so that the end result I get is as follows:
Timestamp Temperature Humidity
2018-05-01 09:10:00 40.1 80.06
So essentially, the value at 09:10 is the average of the values at 09:00, 09:05 and 09:10.
And the value at 09:25 would be the average at 09:15,09:20,09:25.
I have tried window functions and aggregate, but seem to be unable to get it to work.
Thank you for your input!