Getting sum of values grouped by predicate

Thank you so much Michel!

I’m so backwards when it comes to dgraph. It hadn’t occurred to me to use the reverse edge on payment type to get the amount.

Now I just need to figure out how to do this on a specific subset of bills (based on datetime). I’m guessing a combination of var queries (one for the bills in question, to get the uid of the payments associated with those bills, then use that collection of uids as a filter for the “~paymentType” edge)

1 Like