I am trying to make a view of taxonomy terms that are used in content.

I created a test content type with a taxonomy term field, and used devel to generate content.

I've created a view of taxonomy terms, and added a relationship to the content with that taxonomy field: enter image description here

Edit As stated above, I created a taxonomy view. I don't think these symptoms are caused by nodes being the base table enter image description here

And, naturally, it duplicated a row for the taxonomy term for each content that contains that term:

enter image description here

I just want a list of the taxonomy terms used, with no duplicates, which would be this:

rudusteueph
dacigiwucl

So I made the relationship required: enter image description here

which got rid of spathew. Then I removed the title field from the view. However I was still getting duplicates of each content by each term:

![enter image description here

Since I don't want any duplicates, I checked Distinct: enter image description here

However, I am still getting duplicates. How can I get a true DISTINCT result set?

  • You can try using aggregation. Turn on aggregation and try different aggregation settings. I think Group Results Together on your term name field may work. – sonfd Dec 4 at 18:21
  • @sonfd Aggregation fixed my issue. Please add that as an answer so I can accept it. – user1359 Dec 4 at 18:29
up vote 2 down vote accepted

Try using aggregation. Turn on aggregation and try Group Results Together on your term name field.

Besides other already proposed solutions you could also add a Contextual filter to your Views and set it to display a Summary of term names and choose not to display the ones without results.

I haven't tries this on a Taxonomy term views, but you could probably get it to work either way.

Your base table is node content. You should create a taxonomy view and add the relationship to content with the entity reference field pointing to the taxonomy vocabulary. You can then try distinct. If that doesn't work for your, then group the results by the taxonomy field

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.