Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Import Macro Repair

...

Description

Performs mathematical operations on reporting data. The results may be saved as a variable, accessible in the current context.

Parameters

Name

Required

Migratable to Cloud?

Default Value

Description

[default] /name

  • Status
    title(

...

  • X)

  • Status
    titleNO

If provided, the result of the evaluation will be stored in a variable with the specified name. It is accessible via the Variable Supplier (e.g.: "variable:foo").

default

  • Status
    title(

...

  • X)

  • Status
    titleNO

An %injectable% value that will be used if the expression does not evaluate to a valid result.

format

  • Status
    title(

...

  • X)

  • Status
    titleNO

A number format to output the result with.

e.g.: "#,##0.00".

hidden

  • Status
    title(

...

  • X)

  • Status
    titleNO

false

If set to true, the result will not be output.

Editor View

  • Not applicable.

Macro Edit View

  • Not applicable.

Notes

This macro differs from Scaffolding's Evaluate Data in a couple of ways.

  1. The value is only stored temporarily. It can't be accessed from another page, for example.

  2. It can access values outside of the Scaffolding add-on. Any number you can access from a Supplier can be used in a calculation.

  3. There are no special functions for sumtable or avgtable. Instead, use the Stats On Supplier to generate that kind of data.

Expressions

Expressions can be made up of the following:

Description

Value

Description

Value

Numbers

1.234, -987

Variables

%prefix:value%

Basic operations

+, -, *, /, ^

Trigonometry functions

sin(X), cos(X), tan(X), cot(X), sec(X), csc(X), arcsin(X), arccos(X), arctan(X)

Exponential functions

sqrt(X), exp(X), ln(X), log2(X), log10(X)

Shift functions

abs(X), trunc(X), round(X), floor(X), ceiling(X)

Constants

pi, e

Brackets

( <expression> )

Logic-valued expression

( <logic expression> ) ? <true value> : <false value>

Logic operators

=, <>, <, >, <=, >=, !, &, |,

Examples

Basic Mathematics

The following example simply calculates the value of a fraction.

Code Block
Numerator: {number-data:Numerator|decimal=true}1{number-data}
Denominator: {number-data:Denominator|decimal=true}2{number-data}
Result: {report-eval:Result|format=#0.0}%data:Numerator%/%data:Denominator%{report-eval}
Percentage: {report-eval:Percentage|format=##0\%}round(%variable:Result% * 100){report-eval}

Result

Numerator:1
Denominator:2
Result:0.5
Percentage:5000%

Cylinder Calculations

Calculate the properties of a cylinder based on its radius and height.

Code Block
|| Radius | {number-data:Radius|decimal=true} cm ||
|| Height | {number-data:Height|decimal=true} cm ||
|| Base Circumference | {report-eval:Circumference} 2 * pi * %data:Radius%{report-eval} cm ||
|| Base Area | {report-eval:Base Area}pi * %data:Radius%^2{report-eval} cm ^2^ ||
|| Side Area | {report-eval:Side Area}%data:Height% * %variable:Circumference%{report-eval} cm ^2^ ||
|| Total Surface Area | {report-eval}%variable:Side Area% + %variable:Base Area% * 2{report-eval} cm ^2^ ||
|| Total Volume | {report-eval}%variable:Base Area% * %data:Height%{report-eval} cm ^3^ ||

Radius

10

cm

Height

30

cm

Base Circumference

62.83185307179586

cm

Base Area

314.1592653589793

...

cm 2

Side Area

1884.9555921538758

...

cm 2

Total Surface Area

2513.2741228718346

...

cm 2

Total Volume

9424.77796076938

...

cm 3

...

...

Tutorial Examples

...

How to calculate numbers stored in List Data macro

...

Calculating the Number of Values Selected in a List

...

All page states within a space

...

Calculating Work Hours in a Day

...

All pages with the 'Approved' state in the last month

...

Message banners for pages

...

Pages that require my approval

...

Tasks assigned to me

...

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
excerptTypesimple
cqllabel = "report-eval"