I don't think JMP can do exactly that, with an arbitrary formula evaluated over the dynamic grouping.
If you know the grouping and can create a formula, be sure to use the Col functions and provide the grouping column(s) as BY variable(s): Col Sum( :HC, :KeyEE ) / Col Sum( :TER, :KeyEE )
Otherwise you can compare sums (inferring the ratio) with a table in Tabulate:
Or graphically in Graph Builder: