COQL Query, trying to add GROUP BY and SUM

COQL Query, trying to add GROUP BY and SUM

hello

I play with coql, works good

this my code and the return json (excerpt)
  1. queryMap = Map();
  2. queryMap.put("select_query","select el_quote_date, Grand_Total, Contact_Name, Created_By from Quotes where Created_Time between '" + before + "' and '" + cur + "'");
  3. response = invokeurl
  4. [
  5. url :"https://www.zohoapis.eu/crm/v3/coql"
  6. type :POST
  7. parameters:queryMap.toString()
  8. connection:"el_make_api_call_zoho_crm_coql"
  9. ];

  10. allquotes = response.get("data");
  11. info allquotes;
  12.   {
  13.     "Grand_Total": 5100.78,
  14.     "el_quote_date": "2023-11-29",
  15.     "id": "435213000022924021",
  16.     "Created_By": {
  17.       "id": "435213000012625001"
  18.     },
  19.     "Contact_Name": {
  20.       "id": "435213000022924013"
  21.     }
  22.   }, etc....

I'm trying to explain what I need
I 'd like to have SUM & Group by :
1- sum (Grand_Total) of quotes that belongs to Created_By (id of the user), count quotes
I think to get the user name need to have a JOIN because in the result we have only the user id (see above)
the results will be something like these :

  1. {
  2.     "SUM Grand_Total": 15000,
  3.     "Count": 17,
  4.     "Created_By": "Mr XXXX"
  5. },
  6. {
  7.     "SUM Grand_Total": 1000,
  8.     "Count": 5,
  9.     "Created_By": "Mr YYYY"
  10. } etc....
Hope I'm clear,

Thanks for the insights