LogoLogo
  • GETTING STARTED
    • Welcome to the NLX platform
    • How NLX works
    • Guides
      • Analytics dashboard
      • Chat
      • Generative Journey (Slots)
      • Model Context Protocol
      • Voice
      • Voice+
      • Touchpoint components
        • Carousel modality
        • Video modality
    • Terms & concepts
    • Generative AI
    • Developer
  • Build
    • Workspace setup
    • Flows
      • Intro to flows & variables
      • The Canvas
      • Flow settings
      • Nodes
      • Flow appearance
    • Resources
      • Actions
        • Implementation
        • Request model
      • Analytics tags
      • Context variables
      • Data requests
        • Implementation
        • Response model
        • Request model
      • Knowledge bases
        • Ingest content
        • Add metadata (beta)
        • Apply KB
      • Lifecycle hooks
        • Implementation
      • Modalities
      • Secrets
      • Slots (custom)
        • Adding values
        • Translating slots
      • Voice+ scripts
        • Add + download script
        • Deploy script + install SDK
        • Create Voice+ flow
    • Integrations
      • Channels
        • Alexa
        • Amazon Chime SDK
        • Amazon Connect
        • AWS End User Messaging SMS
        • AWS End User Messaging Social
        • Bandwidth
        • Genesys
        • Twilio
        • Zendesk Sunshine
      • LLM services
        • Amazon Bedrock
        • Anthropic
        • Azure OpenAI
        • Cerebras
        • Cohere
        • Google Vertex AI
        • Groq
        • NVIDIA
        • OpenAI
        • xAI
      • NLP
        • Amazon Lex
        • Google Dialogflow
        • Google Dialogflow CX
        • Custom NLP
    • Translations
  • Test & Deploy
    • Applications
      • Attach flows
      • Assign default behavior
      • Add channels
        • API
          • REST API
        • Alexa
        • Amazon Chime SDK
        • Amazon Connect
        • AWS End User Messaging SMS
        • AWS End User Messaging Social
        • Genesys
        • Genesys SMS
        • Messenger
        • Microsoft Teams
        • Slack
        • SMS via Bandwidth
        • Twilio SMS
        • Twilio Voice
        • WhatsApp via Twilio
        • Zendesk Sunshine
      • Deploy
      • Optional: Set lifecycle
      • Optional: Set languages
    • Test
      • Test a conversation
      • Automated tests
      • Test an external integration
  • Analyze
    • Conversations
    • Analytics
      • Creating dashboards
      • Formulas & multi-metrics
      • Canvas analytics
    • Training
  • Workspace Settings
    • Escalation channels
    • Resource tags
    • Audit
  • Admin
    • Access control
      • Roles & permissions
    • Notifications
    • FAQ
    • Contact support
Powered by GitBook
On this page
  • Why use formulas?
  • Supported charts
  • Basic arithmetic functions
  • Math functions
  • Using formulas
  • Apply multi-metrics
  1. Analyze
  2. Analytics

Formulas & multi-metrics

Learn to apply calculated metrics to analytics dashboards in your NLX workspace

Why use formulas?

Formulas can be used to convert values (seconds to milliseconds) or combine multiple filtered metrics into one. This enables you to view desired data without the need to looking at several charts and manually perform calculations.

Formulas enable you to add one or more metrics to a mathematical expression to create an entirely new metric. Metrics created through a formula are called calculated metrics. You can reference existing metrics, numbers (1, -2, 4.513) or mathematical constants such as π (pi). Parentheses () can be used to denote the order of operations within your expression.


Supported charts

Be sure to add one or more datasets before applying a formula to your chart.

The following lists all chart types where formulas may be used:

  • Bar chart: Displays formula output as a new bar

  • Line chart: Displays formula output as a new line

  • Table: Displays formula output as a new column


Basic arithmetic functions

The following lists the basic arithmetic functions supported; x, y represent constants or metric references:

Operation
Usage
Examples

Addition

+

1+1 {SampleMetric}+1

Subtraction

-

10-8 {SampleMetric}-20

Multiplication

*

2*3 5*{SampleMetric}

Division

/

1/2 1/{SampleMetric}

Unary subtraction

-x

-1 -{SampleMetric}


Math functions

The following lists the mathematical functions that are supported:

Operation
Usage
Examples

Absolute value

abs(x)

abs(-1) abs({SampleMetric})

Square root value

sqrt(x)

sqrt(4) sqrt({SampleMetric})

Ceiling function

ceil(x)

ceil(1.67) ceil({SampleMetric})

Floor function

floor(x)

floor(3.2) floor({SampleMetric})

Power function

power(x,y)

power(2,2) power({SampleMetric}, 10)


Using formulas

To add a formula to a Bar chart, Line chart, or Table:

  • Select an existing Analytics dashboard and click Edit dashboard, or choose + Add dashboard to create a new dashboard

  • Select + Add panel > Hover over panel > Click the edit icon

  • Select + Add dataset or + Add data column; Repeat as needed

  • Choose + Add formula or + Add formula column > Enter a name

  • Formula: Enter the mathematical function. To reference an existing metric, type an open curly bracket { that displays a list of available metrics to reference

  • Formula unit: Choose how the calculated metric is displayed. For example, if your formula outputs a percentage, you can select the Percentage option from the dropdown to display a percent % character next to your numerical output

  • Click Save

Referencing a calculated metric into another formula input is unavailable.


Apply multi-metrics

Analytics can support multiple datasets within the same panel, allowing you to compare different metrics against each other in the same chart without the need to create individual charts for each metric. For example, you may want to compare the performance of different intents against each other over the same period of time.

As an example, let's compare the number of Actions invoked versus the number of Data requests invoked in a single Line chart:

  • Select an existing Analytics dashboard and click Edit dashboard, or choose + Add dashboard to create a new dashboard

  • Select + Add panel > Hover over panel > Click the edit icon

  • Enter a name and description of the panel

  • Select Line chart for Chart type

  • Click + Add dataset link > Enter name (in this example, we'll name it Actions)

    • Select the metric for the data to be measured, which in this case is Actions invoked

    • Select the time interval of how the data will be displayed in the line chart. Day will show the results on a daily basis

    • Select the sum aggregation to get the total counts of actions invoked

    • Select respective filters to create any subset of data

  • Click + Add dataset > Enter name (in this example, we'll name it Data requests)

    • Repeat steps above as done for the Actions dataset, except select the metric Data requests invoked

  • Click Save

Last updated 5 days ago

Multi-metrics are currently only supported for .

Bar charts, Line charts, and Tables
Actions and Data Requests Line chart with legend