If the count method is used, the formula parameter is ignored, and can be left empty. (This is more useful when combined with the queryformula parameter described below.)

aggregate({},"count") ☞ returns the number of visible records in the database

By adding a query formula, you can restrict the aggregate to a subset of the database. This example calculates the total amount of all records that are more than 30 days old.

aggregate({Amount},"+",{Date<today()-30}) ☞ total of all records that are more than 30 days old
aggregate({Salary},"average",{Department="Engineering"} ☞ average salary of engineers
aggregate({},"count",{Salary > 2 * aggregate("Salary","average")})
☞ number of staff members that make more than twice the average salary

I have been working on this problem with Michael before he posted the question. I think the problem is that the import( function is not being evaluated when placed inside the formula of the aggregate( function which is inside the array filter function.

No. I hadn’t even tried. I didn’t have a suitable database for testing. Your original question only mentioned one formula, and it was behaving exactly the way the documentation said it would, so I thought it was simply a case of misreading the documentation.