I was wondering if it's possible to create a view ith group by content.
For example: i have created this nodetype with the CCK module. That type holds a field where users can give in a distance.
Now i want to create a view with only 2 fields: username and average distance.
I know in sql it would be something like this:
select user, avg(distance) from myType group by user
but i don't know how to translate this to a view

Comments

gsally’s picture

I've been digging through the views documentation because I'd like to do something similar. I can't find any documentation or code samples that cover this use case.

Passero’s picture

Nope, i didn't ding a solution for it... perhaps in the future i will dig into the code of the views module when i have some time :)

ff1’s picture

Does anyone know if this type of query is now possible in Views 2?

WorldFallz’s picture

not sure but maybe the http://drupal.org/project/views_calc module would be helpful.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

ff1’s picture

Thanks for that.

That module is currently waiting for a drupal 6 upgrade and to align it with views 2. I'll try the module in drupal 5 to see if it does what I want.