Skip to main content

Calculated Fields Pro

Ninjalytics includes a powerful field builder for defining your own fields based on formulas, other fields, and functions. The field builder can be launched by clicking the New Calculated Field in the Fields toggle, or by clicking the Edit button for a calculated field that is already added to the report. Any work done in the field builder to create or edit fields is global - fields and their definitions are available across reporting presets.

Field builder formulas consist of a combination of fields and/or static values that are combined using operators and/or functions to produce a single output value.

Fields

Many of the same field types that you would see in the dropdown in the Fields section are also available for selection in the field builder. Selecting a field in the dropdown automatically adds it to the Formula box.

Functions

Ninjalytics supports the following functions:

  • POST_TITLE() - Get post title: Gets the title for a post ID.
  • POST_URL() - Get permalink: Gets the permalink (URL) for a post ID.
  • TIMESTAMP_TO_STRING() - Timestamp to string: Gets a formatted date and time in the local time zone from a numeric UTC timestamp.
  • TIMESTAMP_TO_DATE() - Timestamp to date: Gets a formatted date in the local time zone from a numeric UTC timestamp.
  • TIMESTAMP_TO_TIME() - Timestamp to time: Gets a formatted time in the local time zone from a numeric UTC timestamp.
  • CONCAT() - Concatenate: Join strings of text together.

You can click a function description to insert it into the formula box, or simply type the function name as shown above.

Operators

Ninjalytics supports + (addition), - (subtraction), x (multiplication), and / (division), as well as parentheses to define order of operations. You can click an operator to insert it, or simply type the corresponding character into the formula box.