count rows with filter condition within unfiltered list
How can I count rows in a table based on a filter condition, while basing the query itself on an unfiltered query?
- I have a list of invoices and credit notes.
- I am running an aggregation sum([net_revenue]) group by [client_id]
- invoice amounts are positive and credit note amounts are negative
- => so I end up with a list of [client_id]'s next to their total revenue (= invoices - credit notes)
- Now I would like to add a column displaying the count of INVOICES only (column [type] = "invoice").
In SQL I'd simply add an inline-select and count filtering the inline-select by column [type].
I can't however find a way to accomplish this in YellowFin.
Thanks & Regards