Formulas and Calculations
| Platform: | AvailableWebNot availableMobile |
|---|---|
| Plan Type: | Not availableBasicNot availableEssentialNot availablePremiumAvailableEnterprise |
| User Type: | Not availableRequesterNot availableFull UserAvailableAdministrator |
Use formulas in Report Builder to add calculated columns in custom reports. You can combine numerical data to calculate totals, compare values, or measure elapsed time without exporting your data. For example, you can:
- Calculate total inventory value by multiplying quantity by unit cost.
- Calculate days since an asset was created.
- Compare planned and actual costs.
A formula column behaves like any other column: it can appear in the custom report table, used in charts, and referenced in filters.
Requirementsโ
Before adding formulas to a custom report:
-
From the sidebar, select Reporting.
-
In the Reporting module, select + Build report.
-
Do any of the following:
- Prompt Report Builder AI to build a report. For details, see Build a Custom Report with AI.
- Select Use a template to build a report with a MaintainXยฎ template. For details, see Build a Custom Report with a Template.
- Select Build manually to build a report from scratch. For details, see Build a Custom Report from Scratch.
-
In Report Builder, select the Build tab.
-
In the Build tab, under the Data and dimensions section, select + Add formula.
A Formula card appears in the Data and dimensions section.
Write a Formulaโ
Formulas reference report columns with identifiers, similar to popular spreadsheet applications (e.g., A-Z, then AA, AB, etc.). Use the identifiers in formulas to reference specific columns.
For example, if your custom report contains:
| Column | Value |
|---|---|
| A | Unit Cost |
| B | Quantity |
You can use the following formulas to calculate the total costs: A * B. You can also combine numbers and parentheses. Parentheses control the order in which calculations are performed: (A + B) * 1.15.
Supported Operationsโ
| Operation | Symbol | Example |
|---|---|---|
| Addition | + | A + B |
| Subtraction | - | A - B |
| Multiplication | * | A * B |
| Division | / | A / B |
Supported Column Typesโ
Only certain column types are supported in formulas.
| Column Type | Supported | Notes |
|---|---|---|
| Number | Plain numbers, e.g. Available Quantity. | |
| Currency | Numbers formatted as money, e.g. Unit Cost. | |
| Percentage | Numbers formatted as percentage. | |
| Duration | Numbers formatted as length of time, e.g. Charged Hours. | |
| Date/Timestamp | Only with subtraction. Date and timestamp columns can only be used with subtraction to calculate a duration. | |
| Text | ||
| Yes/No (Boolean) | ||
| Lists | ||
| Formula column | Can't reference another formula. |
Formula Result Formattingโ
Report Builder automatically formats the result of a formula based on the values used.
| Operation | Supported Combinations | Result | Exception |
|---|---|---|---|
Addition (+) |
| Same type as the left operand. | |
Subtraction (-) |
| Same type as the left operand. |
|
Multiplication (*) |
| Currency | Currency * Currency โ Number |
Division (/) |
| Currency | Currency / Currency โ Number |
Special Operation: NOWโ
NOW is a special keyword that represents the current date and time when the report runs. Use it with a date column to calculate elapsed time.
Let's say you:
- Use
Created Atas column A in a formula. - Enter the following formula:
NOW - A.
Report Builder returns the time elapsed since the date in each row, shown as a duration.
You can only use NOW in subtraction formulas with date columns. You can't add, multiply, or divide with NOW.
Limitationsโ
- Formula columns can't reference other formula columns.
- Formula columns can't reference themselves.
- Date and timestamp columns only support subtraction.
- Formulas support a maximum of 10 operations.
- Functions like absolute value, standard deviation, rounding, or percentage change arenโt supported.
Troubleshootingโ
- Why do I have an error message after selecting a column?
Only supported column types can be used in formulas. - Why can't I reference another formula?
Formula columns can only reference standard report columns. - Why can't I use a date column?
Date and timestamp columns only support subtraction to calculate a duration.