group by with condition

Dear all,
I am looking for a way to group by different columns according to a reference column.
I have 1 column containing a first reference time
A second column containing a second refrence time.
A table with different columns where the first one contains a time.
I would like to calculate the mean of all cells in each column of my table between the 2 reference times. I hope I was clear enough.
I put an xlsx file in copy of this message. test forumknime.xlsx (1.8 MB)

Hi @ChakibO -

Here’s a solution I came up with. There’s almost certainly a more elegant way to do this, but I believe this works.

In short, we split your excel file into data and reference times. Then, we loop over the different time ranges, and identify data that falls into a range. We then use GroupBy to calculate the means. After the loop completes, we append the time range columns to the new data.

A screenshot and example workflow are attached. I hope this helps!

LoopOverTimeRangeExample.knwf (26.4 KB)

1 Like

Thank you Scott it works properly!
Chakib,

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