How to calculate the mode in ArangoDB?

11 views
Skip to first unread message

landon...@gmail.com

unread,
Jun 12, 2017, 1:01:11 PM6/12/17
to ArangoDB
I have transactions like this
{"cust_id": "593ec", "recorded": "2015-10-15T11:22:22", "account_id": 1, "account_status": "P" },
{"cust_id": "593ec",  "recorded": "2016-03-06T02:00:11", "account_id": 2, "account_status": "A"}, ...

I want to summarize how many unique customers and for each customer how many unique accounts that customer have and the mode for account status?

Expected result:
[
  {"cust_id": "593ec", "accounts": 11, "status_q1": "A", "status_q2": "N"},
  {"cust_id": "114sd", "accounts": 0,  "status_q1": "P", "status_q2": "P"},
  .....
]

Thank you
Reply all
Reply to author
Forward
0 new messages