I tried to add a view(a) as a field in another view(b). The problem is that because the view a is an aggregated one (I use count to group all results into a number), when it got embedded in view b as a field, all the results of the view a are shown one by one. So to solve this I tried to aggregate the embedded field again. After that I got the error message that SQLSTATE[42S22]: Column not found: 1054 Unknown column 'view' in 'field list'.

So I turn "use aggregate" off, then the error message turns into:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM node node' at line 1

I also tried to use "Aggregate queries", but that gives no result at all.

So to put it short, I was hoping to show a view (just a aggregated field showing the numbers of all of the results) in another view as a field, and that's where I run into troubles. I'm not sure if that's because I didn't do it right or not. Any feedback would be greatly appreciated!

Thanks

CommentFileSizeAuthor
#2 vfv-1881036.patch588 bytesdamiankloip
1.png34.25 KBDrupalDan

Comments

damiankloip’s picture

I'm not surprised. That is probably because you are trying to perform an aggregation function on a computed field, this doesn't exist in the database, so this will never work. I think you're approach is wrong. Wouldn't you want to use aggregation on the child view, not on the view field? then you could get a count from the result of that view?

damiankloip’s picture

Status: Active » Needs review
StatusFileSize
new588 bytes

Let's just make it so that this isn't actually possible.

damiankloip’s picture

Title: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'view' in 'field list' » Disable aggregation for views_field_view_handler_field_view
Status: Needs review » Needs work

Let's change the title.

damiankloip’s picture

Status: Needs work » Fixed

Committed.

Status: Fixed » Closed (fixed)

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