Version 9.1

Create Fields with the Field Builder

Often a report template requires fields that are calculated or derived from other fields in the report template, as described in the following sections.

Converting Dates to Numbers

To calculate a time duration, such as the duration of a backup job, dates need to be converted to a numeric data type.

• Append a .time suffix to a field to convert the date to a number.

With this suffix applied, the result is the number of milliseconds that have elapsed since the epoch time (midnight of January 1, 1970).

Example of a Duration Calculation:

${D.time - C.time}

Where D is the Job Finish Time field and C is the Job Start Time field. Both C and D are date fields.

Syntax for Calculated Fields

Description | Syntax |

Adding attributes | + |

Subtracting attributes | - |

Multiplying attributes | * |

Dividing attributes | / |

If-then-else | (condition) ? (value if true) : (value if not true) |

Equality check | == |

Not equal check | != |

Greater than | > |

Less than | < |

Greater than or equal to | >= |

Less than or equal to | <= |

And (joining 2 conditions) | && |

OR (joining 2 conditions) | || |

Examples of Calculated Fields

Note that all expressions need to be enclosed in the following format: ${ }

Description | Expression |

Display status ID having alias A and values 0, 1, 2 to display Success, Warning and Error. | ${A == 0 ? 'Success' : A == 1 ? 'Warning' : 'Error'} |

Add two numeric fields A and B. | ${A + B} |

Calculate percentage A from A and B. | ${A / (A+B)} |

Convert from A which is in KB to GB. | ${A / (1024 * 1024)} |

Calculate duration by subtracting values of date fields | ${G.time - F.time} |