Skip Navigation

[Resolved] Create a "Pivot Table" View

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Furlan 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#617121
2018-02-18_01-49-57.png

Hi,

I have a new challenge.

Again, this is the basic structure of my site.
RESPONSIBLEs <---- ASSIGNATIONs----> TASKs

I am trying to display a View in a kind of "Pivot Table" or spreadsheet. The idea is to have in the rows of the spreadsheet the values corresponding to "Tasks" Post Type and in the columns "Responsibles" Post Type. The value in the intersection is ruled by an ASSIGNATION.

Any idea how could I achieve this view. is there any document referent to a similar request?

Thanks.

#617335

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Juan Manuel

It will be possible to do this but require running so many View queries it will be very demanding in terms of resources, I'm not sure it is very sensible to even try.

You will need a View which loops over the Task posts (the rows).

For each row you will nest a View which loops over the Responsible posts (the columns).

Each nested iteration of this second View is effectively a cell in your table, but to get the value of the intermediate Assignation post you will need another View which has parent post filters for both Task and Responsible (the Task will have to be passed from the outer View with a shortcode attribute), and this View will have to be run for every cell.

So, if you had a 10 x 5 table as per your example, your Views would need to run 61 times, actually 62 because you would need a View to generate the column titles, and if your table grew in size the number of queries could significantly increase.

The outline of what is required is there if you want to try it...

#617364

Hi Nigel,

Sounds crazy. I won't even try.
I am searching for alternative views, literally.

Thanks for your help.