I have this recurring cycle detected problem that I cannot figure out and I'm hoping someone can help me.
See the attached example script. It generates a table. The idea here is I want to label each continuous runs of 1 in Column 1 as an Event with a sequential number.
The formula works. But when I make any modifications to the table or Rerun Formulas I get one, two, or sometimes three cycle detected errors. This is just an example table. On my actual data table, I have had to hit Ignore All Cycles sometimes up to a dozen times if I change a column formula or do other editing on the table.
Does anyone know what is causing this?
Thanks
New Table( "Cycle Problem",
Add Rows( 21 ),
New Table Variable( "P1", 3 ),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0]
)
),
New Column( "Column 2",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
Row() == 1, :P1 = 0,
:Column 1 == 1 & :Column 1[Row() - 1] == 0, :P1 = :P1 + 1,
:Column 1 == 1, :P1
)
),
Set Selected
)
)