DYNAMIC CALCULATIONS

The Dynamic Calculations widget is a compact tool for performing arithmetic and statistical operations on numeric and date meta fields from JetEngine and ACF. It supports single values and arrays, including mathematical expressions, sum, average, min/max, and date-difference calculations. Use it anywhere a computed value is needed—listing grids, current posts, or current users.


Dynamic Calculations Overview

USAGE & SCOPE

Select your data context via the Query Source control:

Note: Ensure your chosen source returns numeric or date values compatible with the selected operation.


Settings Icon

WIDGET SETTINGS

Configure the calculation, formatting, and output style.

  • Query Source: Listing Grid / Current Post / Current User.
  • Operation Type:
    • Math (+ - * /)
    • Sum
    • Avg
    • MinMax (range)
    • Since hours (date difference)
  • Meta Field Keys / Macros: Comma-separated list of meta keys or macros (e.g. %value1%, %value2%, %today%, %current_post_date%). Date macros accept hours, minutes, days offsets.
  • Prefix & Suffix: Optional text before/after the result.
  • Output Format: plain (inline) or list (<li> items).
  • Number Formatting: Strip non-digits (remove “.” thousands separators; preserve “,” decimals).
  • MinMax Prefix/Suffix: Supply combined or individual prefixes/suffixes for Min and Max values.

Supported operations:

OPERATION SYNTAX Examples

Define each calculation block with this pattern:

[Operation: Math (prefix: | shuffix)]
%value1% - %value2%

[Operation: Math]
%number_a% \* %number_b%

[Operation: Sum]
%val1%, %val2%, %val3%

[Operation: Avg]
%score1%, %score2%, %score3%, %score4%

[Operation: MinMax (Min: "Low: " | suffix: " km"; Max: "High: " | suffix: " km")]
%val1%, %val2%, %val3%

[Operation: Since hours (prefix: "Elapsed: " | suffix: " hours")]
%current_post_date% %today%

You can define hours, minutes, days

EXAMPLE USAGE

Given meta fields:

distance1: 5

distance2: 10

distance3: 7

[Operation: Sum] %distance1%, %distance2%, %distance3% Renders:

22 </code>

TUTORIAL & ADVANCED USAGE

  1. Select Source
    Choose Listing Grid, Current Post, or Current User.
  2. Define Operation
    Pick the operation type—use “Since hours” for date differences and date macros.
  3. Enter Keys/Macros
    List your meta keys or date macros, separated by commas.
  4. Set Prefix/Suffix
    Optionally add labels or units around your result.
  5. Choose Output
    Plain inline text or list items.
  6. Enable Formatting
    System will strip non-numeric characters automatically and apply locale-appropriate separators.