Mean of the n lowest consecutive hours


i have a dataset with hourly consumption data. I need the mean result of the lowest 8 consecutive hours in the weekend. With Group by node it´s easy to get the mean of the hole weekend but how i can get mean of the lowest 8 consecutive values?

Short example (only one day of data):

|22.10.2022 00:00|200|
|22.10.2022 01:00|300|
|22.10.2022 02:00|400|
|22.10.2022 03:00|500|
|22.10.2022 04:00|300|
|22.10.2022 05:00|100|
|22.10.2022 06:00|50|
|22.10.2022 07:00|40|
|22.10.2022 08:00|40|
|22.10.2022 09:00|30|
|22.10.2022 10:00|100|
|22.10.2022 11:00|40|
|22.10.2022 12:00|40|
|22.10.2022 13:00|50|
|22.10.2022 14:00|100|
|22.10.2022 15:00|200|
|22.10.2022 16:00|300|
|22.10.2022 17:00|400|
|22.10.2022 18:00|500|
|22.10.2022 19:00|300|
|22.10.2022 20:00|200|
|22.10.2022 21:00|100|
|22.10.2022 22:00|100|
|22.10.2022 23:00|200|

Mean of the bold values is 48,75

Thanks for your help. :slight_smile:


OK found the solution for my own. First create a new column with the Moving Average node and Group by on this column with min aggregation. :slight_smile:

1 Like

Hi @morpheus2010 and welcome to the KNIME community forum

One possible solution is to use a moving average window to calculate the lowest 8 average position within your “Value” column. Then, keep only the lowest value using the -GroupBy- node.

There are two nodes for this in KNIME but only the more advanced -Moving Aggregation- node allows EVEN size sliding windows, i.e. 8 as in your case.

Please find below the workflow implementing your solution:

Hope it helps.



PS 1: I didn’t see your previous post since I was already writing mine. Yes, it is exactly that.

PS 2: Thanks @takbb for the great component you implemented to convert data from the forum into a table. It works like a charm !


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