Tuesday, January 30, 2018

Calculating Profit Margin and Other Expressions with Division

An expression that does division, such as calculating profit margin, is trickier than it looks. The problem is how do you calculate a group or end-of-report value?

For example, you can create a formula to calculate the profit margin of an item using something like "(SaleAmount - Cost)/SaleAmount * 100." That expression works correctly for detail items but not for groups. Suppose an invoice has one item sold for $2.00 that you paid $1.00 for (a 50% margin) and another item for $20.00 that you paid $15.00 for (a 25% margin). The total sale amount for the invoice is $22.00 and the total cost of the items is $16.00 for an overall margin of 27%. For a group footer for that invoice, you clearly can't sum the margins (25 + 50 = 75%), nor can you average them ((25 + 50)/2 = 37.5%). What you really need the report to do is to total the sales amounts, total the cost amounts, and then calculate the margin at the group level from those totals.

Fortunately, Stonefield Query has a way to do that: formulas with group level recalculation. See the help topic for “Creating Your Own Formulas” for a discussion of how to use that feature.

If you’re doing the calculations manually in the Advanced Report Designer rather than with formulas, you need to calculate the margin with variables. In the Advanced Report Designer, choose Variables from the Report menu, click Add, enter a name such as GroupPrice, and use these settings:

Value to store: the name of the field containing the price, such as EXTPRICE
Initial value: 0
Reset value: choose which group to restart the calculation on
Calculation type: Sum

This tells Stonefield Query to sum up the price field at the group level. Create another variable named TotalPrice with the same settings but Reset Value should be Report so it sums the price field for the whole report.

Create two more variables, GroupCost and TotalCost, that are similar but use the name of the cost field instead.

Finally, use these variables in fields in the Group Footer band and Summary band to display the overall margin. For example, for the one in the Group Footer band, use:

iif(GroupPrice = 0, 0, (GroupPrice - GroupCost) / GroupPrice * 100)

That way, the calculation is done the same way you'd do it by hand: total up the price, total up the cost, and do the calculation on the totals.

Monday, January 22, 2018

ClickBase Competitive Upgrade

With the ending of support for ClickBase for AccountMate, finding a replacement may be difficult. Stonefield Query is that replacement.

Stonefield Query for AccountMate provides a step-by-step method to create professional business reports from information stored in AccountMate. Anyone can create detailed reports, high level overview, drill-down, charts/graphs, pivot tables, and more in minutes rather than hours. Stonefield Query for AccountMate works with the latest version of AccountMate SQL and earlier versions.

Stonefield Software is offering AccountMate users a 50% off competitive upgrade from ClickBase to Stonefield Query for AccountMate until June 30, 2018.  That includes one Report Designer license and five Report Viewer Subscription licenses. Contact sales@stonefieldquery.com for more details.

Thursday, January 11, 2018

Stonefield Query for AccountMate webinars

Stonefield is presenting a webinar for AccountMate Business Partners on Stonefield Query for AccountMate and our new ClickBase competitive upgrade on Wednesday, January 17, 2018 at 1:00 Eastern. Register today on the AccountMate Business Partner web site.

We are also presenting a webinar for AccountMate users on Stonefield Query for AccountMate and our new ClickBase competitive upgrade on Wednesday, February 7, 2018 at 1:00 Eastern. Register today at https://www.accountmate.com/education/webcasts.asp