Parameters and Calculated Fields
Parameters and calculated fields are the two mechanisms for introducing dynamic values into a Report Forge output. Parameters expose runtime-selectable values (e.g., reporting period, project reference) that the consumer or the template engine provides. Calculated fields derive new values from existing fields using expressions, removing the need to pre-compute values in the source data.
Parameters
Parameter types
| Type | Description | Example use |
|---|---|---|
| Text | A free-text string value. | Package reference, document prefix, contractor name. |
| Number | A numeric value. | Threshold value, target cost, N for Top-N limits. |
| Date | A calendar date. | Reporting period end date, data date, cut-off date. |
| Select (single) | One option from a predefined list. | Reporting period (Jan/Feb/Mar...), phase, status. |
| Multi-select | Multiple options from a predefined list. | Disciplines, contractors, zones, statuses. |
Creating a parameter
- In the Data tab, click Parameters.
- Click + New parameter.
- Set the Name (used in expressions and filter bindings as
{ParameterName}). - Set the Type (text, number, date, select, multi-select).
- For Select and Multi-select types, define the list of allowed values (static list or a field from a data section).
- Set a Default value that is used when the report is previewed without a consumer-provided value.
- Optionally set Required to force the consumer to provide a value before the report renders.
Referencing parameters in filters
In the Filters panel, when entering a filter value, type {ParameterName} to reference a parameter. The filter will use the parameter's current value at render time.
Referencing parameters in text
In text boxes and component titles, use {{param.ParameterName}} to insert the parameter value as text. Example: a page title reading Schedule Report — {{param.ReportPeriod}}.
Cascading parameters
To make one parameter's available options depend on the selection in another:
- In the parameter's value list definition, select Dynamic list from section.
- Set the source section and the field to use as options.
- Add a Filter on the source section referencing the parent parameter: e.g., the Discipline parameter list is filtered to disciplines present in the selected Phase.
Calculated fields
What a calculated field is
A calculated field is a named expression evaluated per row (before aggregation) or as a scalar across the section (post-aggregation, as a measure). Calculated fields appear in the Fields panel with an fx badge and can be bound in component wells exactly like native fields.
Creating a calculated field
- In the Fields panel, click + Calculated field at the bottom of the section.
- Enter a Name for the field.
- Select the Scope: Row-level (evaluated per record) or Measure (evaluated after aggregation across the filtered rows).
- Enter the Expression using the expression editor.
- Set the Output type (Number, Text, Date, Boolean) so the component knows how to format it.
- Save. The field appears in the section field list with an
fxbadge.
Expression syntax
Calculated fields use a formula language similar to Excel:
| Element | Syntax | Example |
|---|---|---|
| Field reference | [FieldName] | [ActualCost] |
| Parameter reference | {ParameterName} | {TargetBudget} |
| Arithmetic operators | + - * / | [EV] - [AC] |
| Comparison operators | = <> > < >= <= | [Float] <= 0 |
| Logical operators | AND, OR, NOT | [Status] = "A" AND [Float] > 0 |
| IF statement | IF(condition, true_value, false_value) | IF([CPI] >= 1, "On track", "Overrun") |
| SWITCH / CASE | SWITCH([Field], val1, result1, val2, result2, default) | SWITCH([RAG], "R", "Red", "A", "Amber", "G", "Green", "Unknown") |
| String functions | CONCAT(a, b), LEFT(s, n), RIGHT(s, n), MID(s, start, n), LEN(s), UPPER(s), LOWER(s), TRIM(s) | CONCAT([Discipline], " - ", [Zone]) |
| Math functions | ABS(n), ROUND(n, d), FLOOR(n), CEILING(n), MIN(a, b), MAX(a, b), SQRT(n) | ROUND([EV] / [BAC] * 100, 1) |
| Date functions | TODAY(), NOW(), DATE(y,m,d), DATEDIFF(unit, d1, d2), DATEADD(unit, n, d) | DATEDIFF("day", [BaselineFinish], [ForecastFinish]) |
| Aggregate functions (measure scope only) | SUM([Field]), AVG([Field]), COUNT([Field]), MIN([Field]), MAX([Field]) | SUM([ActualCost]) / SUM([PlannedCost]) |
| NULL handling | ISBLANK([Field]), COALESCE([Field], default) | COALESCE([ForecastFinish], [BaselineFinish]) |
Common calculated field examples
| Use case | Expression |
|---|---|
| Cost variance | [EV] - [AC] |
| CPI | [EV] / [AC] |
| % complete (text) | CONCAT(ROUND([PercentComplete] * 100, 0), "%") |
| RAG label | IF([Float] < 0, "Red", IF([Float] <= 5, "Amber", "Green")) |
| Days from baseline | DATEDIFF("day", [BaselineFinish], [ForecastFinish]) |
| Display date | CONCAT(LEFT([PeriodName], 3), " ", YEAR([PeriodStart])) |
Design rule
Use parameters for values the report consumer should choose or that change between report runs. Use calculated fields for values the report should compute consistently, regardless of who runs it or when.
Related
- Filters Panel — using parameters as filter values
- Fields and Build Panel — binding calculated fields to wells
- Slicers and Filters Component — cascading slicer setup using parameters
- Parameter Strategy — decision guide: parameter vs. filter vs. slicer vs. variable vs. calculated field
- Running Aggregates — cumulative aggregation using running_sum, running_avg, and more
- Report Variables — template-level variables as an alternative to repeated calculated fields