Here are a couple of versions of the formula(They are not tested). They differ in what the Col Max is based on
// formula where col max is based upon only rows with "After" in PMA Counter
// and the Col Max only appears in rows where PMA Counter has "After" in it
dt << New Column( "Current PMA Counter",
Character,
Nominal,
Formula(
If( Row() == 1,
x = Col Max( If( Contains( :Condition, "After" ), :PMA Counter, . ) )
);
If( Contains( :Condition, "After" ),
y = x,
y = .
);
y;
)
);
// formula where col max is based upon all rows
// and the Col Max only appears in rows where PMA Counter has "After" in it
dt << New Column( "Current PMA Counter",
Character,
Nominal,
Formula(
If( Row() == 1,
x = Col Max( :PMA Counter )
);
If( Contains( :Condition, "After" ),
y = x,
y = .
);
y;
)
);
Jim