I have attempted to create a view that accepts an argument that is a taxonomy term and group on (and count the number of instances of) another taxonomy term that comes from the same content type. So far without success.

For example suppose I have a content type called Dogs. And in that type I have a content taxonomy field labled "breed" (field_breed) and I also have a content taxonomy field labeled "color of dog" (field_color).

I want to pass the the term "field_breed" into the view and display the colors users have entered and the number of times each color was entered. Output might look like:

brown 5
black 3
red 2

How can I set this up?

Comments

drupeshare’s picture

I figured it out. I just needed to have the content field and a node: NID field. Then group on the content field and aggregate on the NID field. I had added other fields that were causing the aggregation not to work even though they were not part of the sql aggregation.

Of course, I also added an argument Taxonomy:Term and set the validator to the correct vocabulary type.

rsvelko’s picture

Status: Active » Fixed

you've done this like in the docs (http://drupal.org/node/389230) , right?

marking as fixed

drupeshare’s picture

Yes that is correct.

Status: Fixed » Closed (fixed)

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