Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleMacro Body

The body contains the set of formula specifications to calculate values. Each specification of a formula contain a

  1. Name,
  2. the Aggregate Formula,
  3. the Format,
  4. the Line Formula,
  5. the Input Mapping, and
  6. the Output Mapping.

The elements of the specification are provided in any order within the cells of a table.

NameFormatLine FormulaAggregate FormulaInput MappingOutput Mapping


















..................


Section
titleName

Identifies the formula and the calculated result.


Section
titleAggregate Formula

The formula to aggregate the single values extracted by the Line Formula.

The formula may contain placeholders to values of the document that contains the macro.

The formula may use the placeholders ${SUM} and ${COUNT}. Formulas may use values calculated by formulas defined in a line before it.

PlaceholderDescription
 ${SUM}The sum of values calculated by the Line Formula.
${COUNT}

The count of documents that provided a value for the Line Formula.

For instance if a document does not apply properties for all values of the Line Formula, it does neither contribute to the sum nor to the count.

${NAME_OF_FORMULA}

Where NAME_OF_FORMULA stands for the name of a formula that has been define above the formula that wants to use it.

${NAME_OF_FORMULA$}

The sum value calculated by the formula named NAME_OF_FORMULA.

${NAME_OF_FORMULA§}

The count value calculated by the formula named NAME_OF_FORMULA.


Example Box
titleExamples for Aggregate Formula


Code Block
languagetext
titleUse the sum
${SUM}


Code Block
languagetext
titleUse the average
${SUM}/${COUNT}




Section
titleFormat

The format used to translate the calculated value, both of the Aggregate Formula and the Line Formula.

The value is a valid number format in Java and defaults to decimal.

Valid values are integer, decimal, currency, and anything that can be parsed by DecimalFormat.


Section
titleLine Formula

The formula applied to calculate from each document in the result set.

Use placeholders, like ${Document_Propery_Name} to select values from the documents in the result set.

Example Box
titleExamples for Line Formula


Code Block
languagetext
titleCalculating story points
${Story Points} * ${Story Weight}


Code Block
languagetext
titleAdd up the team sizes
${Team Size}




A

A two-column table to map an input to be applied to a value read from the documents.

This allows to translate text to double values. The mapping is applied to the documents of the result set and the document that contains the macro.

The first column contains the value in its normalized rendered form. The second value is the numeric value to replace that rendered form.

Section
titleInput Mapping
Pending Box
titleNot yet implemented
projectdoc-box-example
titleExample configuration for the Input Mapping


Input Mapping


Good2
Great4
Top Notch8





projectdoc-section
titleOutput Mapping

A two-column table to map a double result value to a textual value, such as the Status Macro. The mapping is applied to the final result of the Aggregate Formula.

The first column allows single numeric values and ranges of the format:

Code Block
languagetext
titleRange format
D MIN ; MAX D


TokenDescription
D

The delimiter D may be either [ or ].

  • If [ is specified for
    • the start value, then the start value is included.
    • the end value, then the end value is excluded.
  • If ] is specified for
    • the start value, then the start value is excluded.
    • the end value, then the end value included.
MIN

The minimum value of the range.

If omitted, the minimum value of the range is the absolute minimum value. Any value smaller than MAX is accepted.

MAX

The maximum value of the range.

If omitted, the maximum value of the range is the absolute maximum value. Any value greater than MIN is accepted.

The defined mappings are processed from top to bottom. The first matching rule provided the representation.

Where one space is shown in the format above there may be any number of spaces, including zero spaces.

Example Box
titleRange examples


Code Block
languagetext
titleEvery value greater than or equal to 10 and smaller than or equal to 30 is accepted
[10;30]


Code Block
languagetext
titleAny number smaller than or equal to 30 is accepted
[;30]


Code Block
languagetext
titleThe number must be exactly 30 - both representations are correct
30

[30;30]


Code Block
languagetext
titleEvery value greater than 10 is accepted
]10;]



Example Box
titleExample configuration for the Output Mapping


Output Mapping


[;10]
Status
colourGrey
titleGood
]10;20]
Status
colourBlue
titleGreat
]20;]
Status
colourGreen
titleTop notch!





...