Skip Navigation

[Resolved] Calculate a column total from a view

This support ticket is created 5 years, 6 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by larryB-3 5 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1240599

I have a page that displays a couple of different views. hidden link

For each view, I'd like to calculate the total of the dollar amounts listed in the last column. So basically at the bottom of each table that the view created, have a row that shows total $ amount for the items listed in that table that were returned from the view query.

#1240613

Hi, there aren't any mathematical summation features built into Views so the only way to achieve this is through custom code. Another ticket here in the forum discusses an approach that works with integers ( requires 1000 instead of $1,000 ):
https://toolset.com/forums/topic/calculate-a-running-total-on-a-view/

So if you have a custom field that holds only the integer price, you could add that in the loop and hide it with CSS, then perform the calculations based on that hidden number.

#1240614

Thanks for the information.