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!