Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Document Properties Marker
doctypeapp-macro
overridefalse
Short DescriptionRun calculations on a set of result documents and renders the results.
NameCalculation Macrohide
Short Namehide
Parent
Parent Property
property-nameName
hide
Audience
Name List
doctyperole
render-no-hits-as-blanktrue
property-restrict-value-rangetrue
propertyAudience
empty-as-nonetrue

Subject
Name List
doctypesubject
propertySubject

Categories
Name List
doctypecategory
property-restrict-value-rangetrue
propertyCategories

Tags

Tag List
namesCalculation
propertyTags

hide
Flagshide
Iteration

Iteration
valueproduction

hide
Identifierprojectdoc-calculation-macro
Type
Name List
doctypeapp-macro-type
render-no-hits-as-blanktrue
property-restrict-value-rangetrue
propertyType

Suite
Name List
doctypeapp, app-extension, product-space
render-no-hits-as-blanktrue
property-restrict-value-rangetrue
defaults-toancestor
propertySuite
hide
App Tool
Name List
doctypeapp-tool
render-no-hits-as-blanktrue
property-restrict-value-rangetrue
defaults-toancestor
propertyApp Tool

Since6.0
Deprecated
Removed
Defined Parameters
Name List
doctypeapp-parameter
render-no-hits-as-blanktrue
render-list-as-comma-separated-valuestrue
no-create-linkstrue
property-restrict-value-rangefalse
propertyDefined Parameters
hide
Page Size Support
(tick)

Sort Keyhide
Section
show-titlefalse
titleDescription

Provide a query to select a set of documents and use formulas to calculate a couple of values. One of these values is rendered, the rest can be accessed by additional macros.

The advantage is mainly that calculating a couple of values is calculated with a higher performance.

Section
titleParameters
intro-textThe macro is configured by the following parameters.
Section
titleDoctype(s)
Transclusion
documentDisplay Table Macro
idsDoctype(s)


Transclusion
taget-heading-level*
documentDisplay Table Macro
idsSpace Keys


Transclusion
taget-heading-level*
documentDisplay Table Macro
idsWhere


Section
titleSort By
Transclusion
documentSort By Property
idsSort By


Section
titleIdentifier

Optional identifier for the HTML element.

Transclusion
taget-heading-level*
documentDisplay Table Macro
idsExclude Self


Transclusion
taget-heading-level*
documentDisplay Table Macro
idsMax Hit Count


Transclusion
taget-heading-level*
documentDisplay Table Macro
idsRestrict to immediate Children
Data Attribute
Description
data-projectdoc-result-countProvided by DefaultThe size of the result set. Note that the count of formulas may be smaller than this number if documents in that set do not provide all values required for the Document Formula.
data-projectdoc-result-...-NRequires value of trueThe infix for this attribute name (...) is derived from the name of the formula that created it.  The 1-based index of the document that provided the values for it.
data-projectdoc-finalresult-...Provided by DefaultThe final result of the formula with a derived name of the formula is used as a suffix.

If no Document Formula is specified, then no individual results will be calculated and therefore not added.

If not checked only the data attributes provided by default are added.
Section
titleRestrict to Favored
Transclusion
documentDisplay Table Macro
idsRestrict to Favored


Section
titleCSS Classes

List of HTML class names to be added to the rendered HTML element.

Section
titleRender

Controls the rendering of the calculated value.

The following values for this parameter are valid.

Parameter ValueDescription
firstThe value calculated by the first formula is rendered (default).
none

Nothing is rendered as text, but the element with the data elements still is.

Choose this option if all calculated values are rendered at different locations down the document.

last

The value calculated by the last formula is rendered.

Choose this option if your formula requires the result of prior defined formulas

Transclusion
taget-heading-level*
documentDisplay Table Macro
idsRender no hits as blank


Section
titleNo Result Text

Text to be rendered if no result is available. This overrides the default text.

Section Index
selectName, Short Description, Data Type|, Since|
render-counter-columntrue
Section Compiler by Reference
refDefined Parameters
render-classesparameters-sections, section-compiler-by-reference, parameters
force-showtrue
ids-Description, Details
extract-short-desctrue


...

Section
titleDetails
Section
titleDouble Precision

All calculations are run with double precision, therefore the macro is not suitable for formulas require with discrete values, not allowing limited precision.

For instance use cases requiring calculations based on currencies (integer values) are not supported.

Section
titleAccess Results from other Calculation Macros

To access the result from another Calculation Macro simply prefix the placeholder reference with the identifier of the macro like this:

Code Block
${macro-id.formula-name}

All values of a formula can be accessed as defined in 

In-Document Link
anchorResult Formula
.

Section
titleResult Calculation only

The macro allows to skip the Document Formula and only provide a Result Formula. This way a value can be calculated by the use of results previously calculated - either by a formula above in the table or by other instances of the Calculation Macro specified previously on the same page.

If no Document Formula is specified, the default results, like SUM or AVG are not present, because the formula does not iterate over the documents in the result set. Only the representation, the literal, and the result are provided.

Example Box
titleNo Document Formula

This example shows how the formula named main uses the value of the revelvance-factor formula of the macro result-repo.

NameFormatResult Formula
mainpercent${result-repo.relevance-factor}*2 + 10%
Section
title
Related Macros
Data Center Compatibility

To support Atlassian Data Center the macro will limit the number of documents to use in a calculation. If the result set is larger than the maximum number of documents, an error message is rendered.

For more information, please refer to 

Static Document Link
documentLimitations on Query Results
.

Version Box
since6.0

The limitation is checked since version 6.0.

Section
titleRelated Macros
Display Table
doctypeapp-macro
render-no-
Display Table
doctypeapp-macro
render-no-hits-as-blanktrue
render-modedefinition
selectName, Short Description
render-classesrelated-macros-table, display-table, related-macros
where$<Tags>~(${Tags})

...

Section
titleReferences
intro-textEvidence for the information is available by the following references.
Tour
render-no-hits-as-blanktrue
render-as-definition-listtrue
marker-column-property-nameTitle
replace-title-with-nametrue
TitleShort Description
Limitations on Query Results
Section
titleResources
intro-textMore information on this topic is available by the following resources.
Tour
render-no-hits-as-blanktrue
render-as-definition-listtrue
marker-column-property-nameTitle
replace-title-with-nametrue
TitleShort Description