Pricing fields calculation
This functionality requires the Math by GravityView plugin version 2.0 installed and activated on your website.
If your form has Pricing fields, it's now possible to perform calculations with them on your View.
In our sample form, we've added 3 Product fields set up as "User Defined Price" in order to collect pricing information:
In our View, besides two normal fields from the form (Year and Month) and the three pricing fields (Product Sales, Labor Sales, and Costs of Goods Sold), we'll be adding two additional Custom Content fields in order to calculate some totals using the [gv_math] shortcode:
Here's the shortcode formula for the Net Sales column:
And here's the shortcode formula for the Gross Income column:
Here's our View so far:
Now, we'll be using the new "Table Footer Calculation" functionality from the Math extension to get totals for each column in our View:
We apply the same logic for all the three Product fields in our View and voilá:
We can also add these footer calculations to Custom Content fields (Net Sales and Gross Income columns), we just need to specify "Custom" for the type of calculation and write the [gv_math] shortcode formula we want:
And here's our final View:
You can view an online demo of this View on our demo website.