I've searched extensively for this over many days, to no avail, but it seems like a question that should have a common answer.

I need to stack views. I have a page where, having created several views blocks, I include them in a specific page content area to stack each view. So the stack of blocks appears as a set of tables. Each view lists content from a different entityform submission set. However, I want to stack them all within the same view so that I can use math and calc expressions on the combined datasets. When they are separate blocks I can't do that within views.

Here's an example. I have one entityform submission set that lists user's vehicles: name, value, amount owed. Then a different entityform collects user's list of computers: Name, value and amount owed. Same for real estate: name, value and amount owed. Each table/entityform has it's own unique set of fields and as such each data element has a different name/field.

Is there a way that I can create one view with all these elements listed in one view and then do things like sum columns, use math expression fields, etc.

Any thoughts/suggestions....?

Comments

sprite’s picture

Check out attachment views.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

hondaman900’s picture

I can only find references to Views Attach, or Views Attachment Block for D6 and unsupported. Are you referring to a D7 resource...?

Thanks in advance.

sprite’s picture

Create a primary view
Create one or more subsidiary views.

In the primary view, display [add] and there is an "attachment" option.

There are youtube videos on this topic ...

https://www.youtube.com/watch?v=LZ5SZ6dS9S8

https://www.youtube.com/watch?v=s9GC-trMH0o

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

sprite’s picture

Although I've never used the following module it may help you as well ...

https://www.drupal.org/project/eva

There are youtube videos that demonstrate this module.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

sprite’s picture

From a UI perspective, what you are doing is common.

Multiple views in the content region is a strategic way to build synthetic pages, placing a set of views into the main content region of a page ordered vertically one above the other.

Possible Solution for aggregates and sums

Create yet another view ...
In this additional view, list all the fields from all the entity form submission sets on which you want to perform calculations.
Using whatever Views plugin you have (see below) to perform that totals/sums/whatever, configure the desired output.

Show this additional View below the other views in the content area, displaying the summary information.
- use CSS/theming strategically to blend all the views' appearance together elegantly.

https://www.drupal.org/project/views_aggregator

https://www.drupal.org/project/views_calc

https://www.drupal.org/project/views_extra_handlers

https://www.drupal.org/docs/7/modules/views/views-howtos/how-to-make-uni...

(research query)
https://www.google.com/search?q=views+sums+totals+calculations+site%3Adr...

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

sprite’s picture

The following module makes it possible to literally embed one view into another view and pass arguments between them.

I don't know if this makes aggregation/summation of both together possible, but it is worth installing on a test site and experimenting with it to determine if it is possible with its mechanisms.

https://www.drupal.org/project/views_field_view

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

hondaman900’s picture

Thanks Sprite - this is awesome! I'll try your recommendations and let you know how it pans out.

Much appreciated :)

hondaman900’s picture

So, I finally got this working by creating a master page view, attaching my additional views. Then using custom class flags (using the Views UI) on the fields I wanted to sum (or exclude from the sum) I used the JS Injector module to add JQuery code to the page to sum the fields I needed across the attached views and place the results in the footer.

This was the only solution that worked for me as each of the available aggregating modules for Views have their scope restricted to the current view.

Thank you for the help and pointing me in the right direction - much appreciated!