Find statement in TDO procedure pane with aggregate(

When I put a find statement in a procedure pane with the aggregate function as the item to find (e.g., ‘Find CheckNumber=aggregate({CheckNumber},“maximum”)’), when I click on the resulting TDO, I get a spinning beach ball.

However, if I assign the aggregate value to a variable first, it works fine.

I don’t know if the spinning beachball would ever stop. With a large database you should expect your first method to be slow. The Find statement is reevaluating its formula in every record until it finds one where the result is true. If the aggregate( function is part of that formula, the aggregate will be reevaluated each time. When you put it in a variable, it just has to retrieve that value from the variable each time. The aggregate( function only needs to be evaluated once.

2 Likes