This is one possible formula option (:B is group column)
New column("Peak", Numeric, Nominal, Formula(
prev_val = Col Moving Average(:Length, 1, 1, 0, :B) * 2 - :Length;
next_val = Col Moving Average(:Length, 1, 0, 1, :B) * 2 - :Length;
:Length - prev_val > 0 & :Length - next_val > 0
));
![jthi_0-1717487573127.png jthi_0-1717487573127.png](https://community.jmp.com/t5/image/serverpage/image-id/64847i61AF95D6BEB5B316/image-size/medium?v=v2&px=400)
-Jarmo