How to do parent query/aggregation based on child aggregation?

Hi,

I have two types in my index, customers and orders, in a parent-child relationship where customers are the parents and orders are the children. Each order has order_time and order_total fields.
How can I:

  • Find the top customers that generated the most revenue in past 30 days?
  • Find all the customers who have generated more than X amount in revenue in past 30 days?

If not possible, are there any tricks to accomplish this?

Thanks,

Drew

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.