How to add Continuous Count row with IF statementHi Expert,
How can I add a new column (D) that able to add count row IF "CompareSeqVsAlarmDP" is 1 in sequence using JSL?
I can reproduce this condition in Excel using IF statement : IF((C27=0),0,(C27+D26)).
But still unsuccessful to convert the IF condition in JMP.
I think something wrong with my IF statement. My JSL statement is as below:
dt1:New Column << Set Formula(If(:"CompareSeqVsAlarmDP=z"n == ., 0, :"CompareSeqVsAlarmDP=z"n + (:New Column - 1)))


thank you in advance!
Automation and ScriptingRe: How to add Continuous Count row with IF statementHere is how I would handle your issue
This formula starts the count off as 0 and then increments it if "CompareSeqVsAlarmDP=z" is not a 0
As Constant( count = 0 );
If( :"CompareSeqVsAlarmDP=z"n != 0,
count++,
count = 0
);
count;
Re: How to add Continuous Count row with IF statementThank you very much @txnelson !
The step gives a better logic.
Just for my future revision, this is how to do it in manually.

The script for New Column: (i just change ; to +)
As Constant( count = 0 )
+If( :CompareSeqVsAlarmDP == !0,
count++,
count = 0
);