Given: db.define_table('items', Field('country'), Field('state'), Field(''product'), Field(sales', 'integer')
Can you show total sales by country and state? I can groupby in a grid using groupby=db.items.country|db.items.state but I can't find how to include the db.items.sales.sum() I've been playing with this hack: https://groups.google.com/forum/#!searchin/web2py/using$20groupby$20and$20sum$20in$20query%7Csort:date/web2py/2dMx-UHbmVs/dAz_V3NWOH4J I can also just use a query and format the table myself (I don't strictly need a grid). -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.