By Passero on
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
Did you figure this out?
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.
Nope
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 :)
Views 2?
Does anyone know if this type of query is now possible in Views 2?
not sure but maybe the
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
Views Calc
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.