Chapter 5. Formulas
Formulas solve problems in reporting, much like they do in spreadsheets. They can be used to change the data type of a field, adjust its value by leveraging functions, or combine it with other field values. Formulas can calculate ratios and do math across summary columns. They can even perform calculations across blocks in joined reports. When reporting, if you are stuck trying to figure out how to present data a certain way, a formula may be part of the solution. Keep formulas in the back of your mind for these situations.
You’ll learn in this chapter that formulas are written with a combination of field references, operators, literal values, functions, and comments. The report builder offers three kinds of formulas you can add to reports: row-level formulas, summary formulas, and cross-block summary formulas, each with its own special uses. Custom formula fields can also be created on objects and then included in your reports.
What Are Formulas and Why Do They Help?
Formulas are made up of field references, operators, literal values, functions, and comments. They help you automatically calculate a value based on the inputs you specify. Although this definition tells you what a formula does, it is often easiest to explain it by demonstrating their power in an example. To calculate a win ratio, for example, you’ll need to add a formula to an Opportunity report that is filtered to only show closed (won or lost) deals. The win ratio formula itself is pretty ...
Get Mastering Salesforce Reports and Dashboards now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.