Dynamic group by

Hi community!

i am new with this tool and i don’t know if this is possible to do. I have a table as the attached one in csv, basically i want to know if in a 5 days correlated branch, the affected customers exceed 50,000.

as far as i know, i need to group by (sum) every 5 days and moving the day branch, but i don’t know how. Is it possible?

Thanks,
KNIME_AffectedUsers.xlsx (8.9 KB)

Hi @fravinale,

there is probably more than one possibility to solve your problem. My solution involves one of KNIME’s Loop Nodes. With the Window Loop Node you can split your data into small subsets to perform operations of them. It allows to create slices based on a time/date feature. So you can slice your data into 5 day intervalls, sum it up in a Groupby Node and make your final evaluation. Here is the workflow. Hope i got your problem right.
imageAffectedUsers_wWindowLoop.knwf (18.0 KB)

hi @MH! thanks for your promt answer :slight_smile:

The workflow that you sent groups every 5 days and it’s correct, but what i need is exactly the same but moving the intervals. for Ex:

  • interval 1: 1-5
  • interval 2: 2-6
  • interval 3: 3-7
    (…)

do you think that this is possible?
thank you very much

No problem. Open the config dialog of the Window Loop Node and change the “step size” parameter to 1.

you are great! thank you very much :slight_smile:

No problem. BTW you can achieve the same goal (though the output table is structured differently) with the Moving Aggregation Node. This way the whole calculation can be done in one Node.