Advanced statistical queries

Just a quick call for comments: I’m working on a project that requires me to perform a little data mining via GROUP BY … WITH ROLLUP (for the Oracle folks: That’s roughly the same as CUBE). Now this is already beyond the scope of the STAT relation, which will always return a single value. My current workaround is to have extra methods in my models that will perform these queries for me via the query builder and return the result. While this works great, it doesn’t feel very Yii’ish. I’d be curious to know how others are handling this.