I have a small requirement to solve.
We have data with every half an hour records starts with 27-09-2018 00:00:00.from the start of day.
Meter_id |Realtimeclock |I_Y|I_B|I_X|
201010 |27-09-2018 00:00:00|1.0|2.0|3.0|
201010 |27-09-2018 00:30:00|1.0|2.0|3.0|
201010 |27-09-2018 01:00:00|1.0|2.0|3.0|
201010 |27-09-2018 01:30:00|1.0|2.0|3.0|
201010 |27-09-2018 02:00:00|1.0| 0 |3.0|
201010 |27-09-2018 02:30:00|1.0| 0 |0 |
201010 |27-09-2018 03:00:00|1.0|2.0|3.0|
201010 |27-09-2018 03:30:00|1.0|2.0|3.0|
From the above table we have to get data as 27-09-2018 00:00:00 of realtimeclock to 27-09-2018 01:30:00 of realtimeclock as one record of count, and see there was value 0 in I_B and I_X in both the timestamps 27-09-2018 02:00:00 and 27-09-2018 02:30:00 ,,so here we can skip these two records and continue with remaining data which starts at 27-09-2018 03:00:00 of realtimeclock and ends at 27-09-2018 03:30:00 and that should be represented as another record with count.
like here output should be,
Meter_id |start_time |End_time |I_Y|I_B|I_X|
201010 |27-09-2018 00:00:00|27-09-2018 01:30:00|4 |4 |4 |
201010 |27-09-2018 03:00:00|27-09-2018 03:30:00|2 |2 |2 |