Select rows based on condition in precedents and followings rows

I have a workflow attached (sorry for the italian name under nodes). I don’t know how to go on after the last node

I need to filter the values in column “Flessibilità kWh” based on two condition:

  1. I have to check if there are more rows from the same day (column “Data”)
  2. If so, I keep the first, and the following only if the time difference is bigger than 2 hours from the previous (column “Hour”)

    So in this example I would like to keep the rows that corresponds to 2019-11-09T09:00 and 2019-11-09T17:00 and filter the row that correspond to 2019-11-09T10:00 because is only one hour away fro the precedent row

UVAM Basiano.knwf (475.5 KB)


Is in this way OK
UVAM Basiano.knwf (49.6 KB)

thank you for your help. it goes in the right direction but it’s not there yet:

the workflow correctly picks 8 am and discard 9am, BUT if it discards 9 am then it has to pick 10am because it’s 2 hours away from the last that was picked, and so on with the following rows.
Is it possible?


Is this better

UVAM Basiano II.knwf (558.7 KB)

1 Like

Thank you so much!!! It does exactly what I need but it was beyond my knowledge.
I’ll study your workflow to learn something new.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.