Grouping/summing items in a summary view

By: brett Marsh | Asked: 08/13/2024
ForumsCategory: How-toGrouping/summing items in a summary view
brett Marsh asked 2 months ago

Hi All - I\'m hoping someone can point me in the right direction, for what I think should be a simple solution. I have a custom view that currently lists all the relevant entries, but needs to be grouped together. I am basically trying to summarize expenses similar to a profit and loss statement. Currently, column 1 lists the Expense Type for each entry and column 2 contains the $ amount (which correctly sums for the item in column 1).  So I\'m trying to achieve the following:  - only list each expense type once in Column 1.   - column 2 is the sum of all entries for the respective expense type in column 1 (this is currently working).  - any expense types (eg Council Rates) that don\'t have a value in column 2 to be hidden.  - column 1 items to be listed alphabetically. I\'ve attached a pic of the simple code and output.  Field [110] in the code is the expense type (eg Council Rates expense) and field [117] is the $ amount. If you have done this before, or can point me in the right direction, any help would be greatly appreciated. Thanks in advance.  

Attachments
1 Answers
Victor Font answered 2 months ago
Use conditionals in your view to test for the value of frm-stats and only display the value if greater than 0.
Victor Font replied 2 months ago

Or as an alternative, create your own shortcode.

brett Marsh replied 2 months ago

Thank you Victor, this worked perfectly! I also found the unique list and alphabetical sorting in the standard view settings. Much appreciate, Brett

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right