Apply aggregate function to column - TanStack