Skip to main content
diagram

Column Properties

Calculated columns use the standard column properties plus the formula property that references a named formula definition.
PropertyTypeDefaultDescription
idstringAuto-generated from header or bindingUnique identifier for the column. Used as the data binding name.
headerstringRequiredDisplay text shown in the column header
formulastringNoneName of a formula defined in the top-level formulas object. When set, the column becomes read-only automatically.
widthnumberSee applicationColumn width in pixels
minWidthnumberSee applicationMinimum width in pixels the column can be resized to
readOnlybooleantrue (auto)Automatically set to true when formula is specified. Cannot be overridden to false for formula columns.
typestringAuto-detectedData type for the column. For calculated columns producing numeric results, typically inferred automatically.
levelnumber1Hierarchical level at which this column appears (1 = top level, 2 = second level). Not set for task columns.
headerGroupstringSee applicationName of the header group this column belongs to for multi-level headers
collapseTostringSee applicationColumn ID to collapse this column into when the header group is collapsed
cellCssstringSee applicationCSS class name(s) to apply to cells in this column
headerGroupCssstringSee applicationCSS class name(s) to apply to the header group row
filterablebooleantrueControls whether users can filter the grid by values in this column
formatstringSee applicationDisplay format string for the column data (e.g., number format)
multiLinebooleantrueEnables multi-line text display within cells
wordWrapbooleantrueControls whether text wraps within cells
isContentHtmlbooleanSee applicationIndicates that cell content should be rendered as HTML
cellRendererstringSee applicationName of a custom cell renderer function for this column
When a column has a formula property set, the column is automatically marked as read-only. This is enforced by the configuration manager and cannot be overridden. Users see computed values but cannot edit cells in formula columns.

Formula Definitions

Formulas are defined in the top-level formulas object of risksheet.json. Each formula is a named JavaScript function that receives an info context object and returns the computed value.
PropertyTypeDefaultDescription
formulasobject{}Collection of named JavaScript functions for calculating derived values in cells. Each key is a formula name, and the value is the JavaScript function body as a string.

Formula Function Signature

Each formula function receives an info object:
ParameterTypeDescription
info.itemobjectThe complete data item (work item) for the current row. Access any field via info.item['fieldId'].
info.valueanyThe current value of the cell (typically null or undefined for formula columns before computation)
The function must return the computed value. Return null to display an empty cell.

RPN Formula Examples

The two most common formulas in FMEA risk analysis are the initial RPN and the revised (post-mitigation) RPN: Initial RPN (commonRpn):
{
  "formulas": {
    "commonRpn": "function(info){ var value = info.item['occ']*info.item['det']*info.item['sev']; return value?value:null;}"
  }
}
Input FieldDescriptionTypical Range
info.item['occ']Occurrence rating1-10
info.item['det']Detection rating1-10
info.item['sev']Severity rating1-10
Revised RPN (commonRpnNew):
{
  "formulas": {
    "commonRpnNew": "function(info){ var value = info.item['occNew']*info.item['detNew']*info.item['sevNew']; return value?value:null; }"
  }
}
Input FieldDescriptionTypical Range
info.item['occNew']Revised occurrence rating (after mitigations)1-10
info.item['detNew']Revised detection rating (after mitigations)1-10
info.item['sevNew']Revised severity rating (after mitigations)1-10
Both RPN formulas return null when the computed value is 0 (falsy). This prevents displaying 0 in the grid when input fields have not been filled in yet. The return value?value:null pattern is the standard approach for null-safe formula results.

Cross-Type Severity References

Risk calculations can reference properties from different work item types in the hierarchy. For example, you can configure a formula to use the severity from the Risk item itself rather than from a linked Accident or Harm work item. The formula accesses the field through info.item['fieldId'] regardless of which work item type provides the value — the data binding resolves the correct source.
The exact behavior of cross-type field references depends on your data type configuration and level hierarchy. The severity source can be changed by modifying which field ID the formula references. Consult your dataTypes configuration to understand which fields are available on each work item type.

Connecting Formulas to Columns

To create a calculated column, define the formula in formulas and reference it by name in the column’s formula property:
{
  "formulas": {
    "commonRpn": "function(info){ var value = info.item['occ']*info.item['det']*info.item['sev']; return value?value:null;}"
  },
  "columns": [
    {
      "id": "rpn",
      "header": "RPN",
      "formula": "commonRpn",
      "width": 80
    }
  ]
}
The column id serves as the data binding. The formula property value must exactly match a key in the formulas object.

Combining Formulas with Cell Decorators

Calculated columns are frequently paired with cell decorators to apply conditional formatting based on the computed value. The cell decorator function references the formula column’s output value.
{
  "formulas": {
    "commonRpn": "function(info){ var value = info.item['occ']*info.item['det']*info.item['sev']; return value?value:null;}"
  },
  "cellDecorators": {
    "rpn": "function(info){ var val = info.value; $(info.cell).toggleClass('boldCol', true); $(info.cell).toggleClass('rpn1', val>0 && val <= 150); $(info.cell).toggleClass('rpn2', val > 150 && val <= 350); $(info.cell).toggleClass('rpn3', val > 350);}"
  },
  "styles": {
    ".boldCol": "font-weight:600;",
    ".rpn1": "background-color: #eaf5e9 !important;color: #1d5f20 !important;",
    ".rpn2": "background-color: #fff3d2 !important; color: #735602 !important;",
    ".rpn3": "background-color: #f8eae7 !important;color: #ab1c00 !important;"
  }
}
The decorator applies CSS classes based on RPN risk thresholds:
RPN RangeCSS ClassVisual Effect
1 — 150rpn1Green background (#eaf5e9), dark green text (#1d5f20)
151 — 350rpn2Yellow background (#fff3d2), dark yellow text (#735602)
> 350rpn3Red background (#f8eae7), dark red text (#ab1c00)
See Cell Decorators and Item Colors for complete decorator configuration reference.

Data Persistence and Export Behavior

Calculated column values are computed client-side in the browser. This has important implications for data persistence and export:

Value Persistence to Polarion

Calculated column values are not automatically saved to Polarion fields when work items are imported or created outside of Risksheet. The computed values are only persisted to Polarion when:
  • A user edits any field in the row within Risksheet (triggering a save that includes formula results)
  • The data sync feature is used (introduced in version 24.5.1) to explicitly store formula column values to Polarion
If you import work items into Polarion (e.g., via CSV import or API) without editing them in Risksheet, the calculated column values will appear empty in Excel exports. This occurs because the formula values exist only in the browser during the Risksheet session but have not been written to the underlying Polarion fields.Version 24.5.1 introduced a data sync feature that ensures formula column values are stored to Polarion fields, resolving this issue for new and edited items.

Export Behavior by Format

Export FormatFormula Value SourceNotes
Risksheet grid (live)Computed client-side in real timeAlways displays current calculated values
PDF exportComputed during exportValues calculated at export time; matches live grid
Excel exportRead from Polarion fieldsValues are empty for items not edited in Risksheet (pre-v24.5.1)

Row Header Styling with Formula Values

The row header renderer can also reference formula column values. For example, the rowHeaderRpnNew renderer accesses info.item['rpnNew'] to color row headers based on the revised RPN:
{
  "headers": {
    "rowHeader": {
      "renderer": "rowHeaderRpnNew"
    }
  },
  "cellDecorators": {
    "rowHeaderRpnNew": "function(info){ var val = info.item['rpnNew']; $(info.cell).toggleClass('rpn1', val>0 && val <= 150); $(info.cell).toggleClass('rpn2', val>0 && val > 150 && val <= 350); $(info.cell).toggleClass('rpn3', val>0 && val > 350);}"
  }
}
When using enum field values in row header styling, access the value using info.item['fieldId'] and compare against enum option IDs (not display names). Enum IDs are the internal identifiers defined in the ratings or enums configuration, which are typically integers for rating scales.

Limitations and Edge Cases

Dependent Enums Not Supported in Formulas

Dependent enum dropdowns (where child enum options filter based on a parent enum selection) are not supported in Risksheet. This means you cannot create a formula-calculated dropdown column that dynamically filters its options based on another column’s value.

Ratings Use Integer IDs

Unlike regular enumerations which use string-based IDs, ratings use integer IDs. When writing formulas that reference rating values, the info.item['fieldId'] returns the integer ID of the selected rating option, which can be used directly in arithmetic calculations (e.g., multiplying severity, occurrence, and detection ratings to compute RPN).

Formula-Calculated Dropdowns Not Available

Creating a dropdown column whose options are determined by a formula is not currently supported. Dropdown columns must reference static enums or ratings definitions in the configuration. Formula columns produce computed values only — they cannot generate dynamic option lists.

Drag and Drop Not Supported

Inserting existing work items into a Risksheet via drag and drop is not supported. Work items must be created through the grid’s “New” menu or linked via item link columns. This is relevant for calculated columns because items created outside Risksheet may not have formula values persisted until they are edited within the grid.

Configuration Interaction Summary

Interacting PropertyEffect on Calculated Columns
formula on columnColumn becomes read-only automatically
serverRender on columnColumn uses server-side rendering instead; not compatible with client-side formula
cellDecoratorsApply conditional formatting based on the formula’s computed value
stylesDefine CSS classes referenced by cell decorators
headers.rowHeader.rendererRow header can reference formula column values via info.item['fieldId']
readonly (global)Does not affect formula calculation; formulas compute even in read-only grids
viewsCalculated columns can be shown/hidden via saved view presets
filterableUsers can filter the grid by computed values in formula columns

Complete Example

A complete FMEA risk analysis configuration with initial and revised RPN calculated columns, conditional formatting, and row header coloring:
{
  "formulas": {
    "commonRpn": "function(info){ var value = info.item['occ']*info.item['det']*info.item['sev']; return value?value:null;}",
    "commonRpnNew": "function(info){ var value = info.item['occNew']*info.item['detNew']*info.item['sevNew']; return value?value:null; }"
  },
  "columns": [
    {
      "id": "sev",
      "header": "Severity",
      "type": "rating:severity",
      "width": 100
    },
    {
      "id": "occ",
      "header": "Occurrence",
      "type": "rating:occurrence",
      "width": 100
    },
    {
      "id": "det",
      "header": "Detection",
      "type": "rating:detection",
      "width": 100
    },
    {
      "id": "rpn",
      "header": "Initial RPN",
      "formula": "commonRpn",
      "width": 80
    },
    {
      "id": "sevNew",
      "header": "Severity (New)",
      "type": "rating:severity",
      "width": 100
    },
    {
      "id": "occNew",
      "header": "Occurrence (New)",
      "type": "rating:occurrence",
      "width": 100
    },
    {
      "id": "detNew",
      "header": "Detection (New)",
      "type": "rating:detection",
      "width": 100
    },
    {
      "id": "rpnNew",
      "header": "Revised RPN",
      "formula": "commonRpnNew",
      "width": 80
    }
  ],
  "cellDecorators": {
    "rpn": "function(info){ var val = info.value; $(info.cell).toggleClass('boldCol', true); $(info.cell).toggleClass('rpn1', val>0 && val <= 150); $(info.cell).toggleClass('rpn2', val > 150 && val <= 350); $(info.cell).toggleClass('rpn3', val > 350);}",
    "rowHeaderRpnNew": "function(info){ var val = info.item['rpnNew']; $(info.cell).toggleClass('rpn1', val>0 && val <= 150); $(info.cell).toggleClass('rpn2', val>0 && val > 150 && val <= 350); $(info.cell).toggleClass('rpn3', val>0 && val > 350);}"
  },
  "styles": {
    ".boldCol": "font-weight:600;",
    ".rpn1": "background-color: #eaf5e9 !important;color: #1d5f20 !important;",
    ".rpn2": "background-color: #fff3d2 !important; color: #735602 !important;",
    ".rpn3": "background-color: #f8eae7 !important;color: #ab1c00 !important;"
  },
  "headers": {
    "rowHeader": {
      "renderer": "rowHeaderRpnNew"
    },
    "columnHeader": {
      "height": 32
    }
  }
}
KB ArticlesSupport TicketsSource Code
  • AppConfigHelper.ts
  • AppConfig.ts
  • risksheet.json
  • PolarionAppConfigManager.java
  • SheetConstants.ts