Is there a way to combine two views so that the results are mixed, also able to be sorted through a common column? I used an attachment, but that seems to only append one view to the bottom or top of another one, they aren't actually integrated. Any guidance would be greatly appreciated.

Comments

sorensong’s picture

Status: Closed (won't fix) » Active

This is a better explaination of what's going on, what I'm trying to do.

I have display "A" and have attached display "B". A has 2 results and B has 15. "Items to display" is 10 for both. the first page shows Ax2 and Bx10- The problem is page two still shows Ax2 (along with Bx5, which is correct).

My question- is there a way to more tightly combine two views?

merlinofchaos’s picture

Status: Active » Closed (won't fix)

There is no way to do this. You could possibly do some evil tricks in the preprocess for a style template and mix rows together but that would be some pretty advanced development work.

sorensong’s picture

Status: Active » Closed (won't fix)

There is a way to do it in SQL- I've done it a long time ago. I'm looking for a module, however. Attachments is close, but no cigar.

merlinofchaos’s picture

Yes,in SQL it's called a UNION and Views doesn't support it.

capellic’s picture

sorensong’s picture

@capellic FANTASTIC! Thanks for the link!

KingSalibah’s picture

@merlinofchaos or other...
I don't understand why Views doesn't have the ability to execute UNION functions. Is there some technical reason why this can't be done? We have a database, we have PHP, thus why can't Drupal have UNION support?

bdanin’s picture

Issue summary: View changes

This is a bummer that the UNION concept doesn't work in Views. I could really use this.

bdanin’s picture

So I found this, and it almost works for what I need. It's a very promising start I think:
https://drupal.org/node/1785294