Can Views do a SUM() aggregation on fields that aren't in the database?

I've tried a lot of techniques, but nothing works. Is it even possible? If so, is there documentation? I can't find any.

This is for a computed Entity property.

Comments

merlinofchaos’s picture

Status: Active » Fixed

Unfortunately no, there's no real way to do this with aggregation; you have to have some way to collapse all the records into one. Since it's not in the database you can't even do subqueries.

Instead, what you would have to do is have a handler that works like prerender_list, but instead of displaying the list of records, it aggregates them in memory. That's the only solution I can think of. An example might be user roles.

Ravi Shankar Karnati’s picture

views is good but my question is how to differentiate the views2 and views3 versions. where can i know which is views2 and views3? Please let me know? Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.