Aggregation with two different conditions

Hi everyone,

I need to do a aggregation using 2 different columns like Date and Quantity, where the result of quantity need to be less of 100 and the diff of days need to be less than 30 days

ex database:
date | qty
01/01/2024 | 30
01/02/2024 | 50
01/03/2024 | 40
01/04/2024 | 30
03/01/2024 | 20
05/01/2024 | 10

result:
start date | end date | qty
01/01/2024 | 01/02/2024 | 80
01/03/2024 | 01/04/2024 | 70
03/01/2024 | 03/01/2024 | 20
05/01/2024 | 05/01/2024 | 10

Hi @bprado

Welcome to KNIME Forum. This is a nice first Forum post :slight_smile: .

I think it is possible see this workflow aggr_based_on_2_conditions.knwf (101.4 KB)
It uses a recursive loop. Every loop the cumulative QTY and number of days between two records is calculated from scratch.


gr. Hans

5 Likes

Hi @HansS

Perfect! Was exactly what we needed.

Thanks!!

1 Like

Hi @bprado,

Good to see that the solution from @HansS does what you need, and welcome to the KNIME community.

1 Like

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