Changes between Initial Version and Version 1 of Ticket #11305, comment 12
- Timestamp:
- Sep 8, 2011, 7:27:28 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11305, comment 12
initial v1 1 1 I need the equivalent of sumifs (http://office.microsoft.com/en-us/excel-help/sumifs-function-HA010047504.aspx?CTT=3) and countifs (http://office.microsoft.com/en-us/excel-help/countifs-function-HA010047494.aspx) to replace a report that is currently baked into an excel spreadsheet somewhere. 2 2 3 In a nutshell, we have orders which have a quantity of items, a total amount for the order, tax amount, and are related to a specific customer name. I need to output something like this: 4 Customer, Total Items (per customer), Total Orders (per customer), Total Amount (per customer), Total Tax (per customer) 5 UserA,6,3,$50,$5 6 UserB,34,2,$1800,$100 3 In a nutshell, we have orders which have a quantity of items, a total amount for the order, tax amount, and are related to a specific customer name. I need to output something like this:[[BR]] 4 Customer, Total Items (per customer), Total Orders (per customer), Total Amount (per customer), Total Tax (per customer)[[BR]] 5 UserA,6,3,$50,$5[[BR]] 6 UserB,34,2,$1800,$100[[BR]] 7 7 8 I would think this sort of thing to be a very common use case. It can be done to the queryset, but sql is good at this sort of thing, so I think it would be better to be able to generate this type of output as a queryset. I'm proselytizing for the integrating the support for conditional aggregates. I like django much better than Excel, but excel has these tools... 8 I would think this sort of thing to be a very common use case. It can be done to the queryset, but sql is good at this sort of thing, so I think it would be better to be able to generate this type of output as a queryset via the ORM. I'm debating whether to fall back to raw() for now. 9 10 I'm proselytizing for integration of support for conditional aggregates. I like django much better than Excel, but excel has these tools...