Identify Largest Range

Hello!

I have the corresponding table:

NAME | MONTH | ALLOCATED COST
Example 01 | 01 | 0
Example 01 | 02 | 1
Example 01 | 03 | 1
Example 01 | 04 | 0
Example 01 | 05 | 1
Example 01 | 06 | 1
Example 01 | 07 | 1
Example 01 | 08 | 0
Example 01 | 09 | 0
Example 01 | 10 | 1
Example 01 | 11 | 0
Example 01 | 12 | 0

I need to count the largest range of lines that contain the number 1.
The expected result for the above case would be 3.

I’m trying to do it through loop, but I’m having trouble creating an incremental variable.

Looking forward to suggestions and help! :slight_smile:

Hello @raulnmsantoro,

you can use Column Expressions node with incremental global variable inside if() function. For usage of global variables inside Column Expressions node check this workflow example:

You should be able to modify it easily to cover your case.

Br,
Ivan

1 Like

Got it and without using loop. Thanks a lot for the help!

1 Like