Aggregation by results of previous aggregation (not sub aggregation)

Hi!
Maybe someone can help me with this:

I can store some geodata like :
"location": { "type": "geo_point", "geohash": true, "geohash_prefix": true }, "profile_id": { "type": "long" }, "updated_at": { "type": "date", "format": "dateOptionalTime" },

I need to get 1 document per each "profile_id" with maximum "updated_at" which in some date range, and then group by "geohash_grid" .

Can I do that with elasticsearch?