Explore Custom Reporting gives you three ways to build your own calculations directly inside an Explore: Custom Dimension, Custom Measure, and Table Calculation. Each one calculates a value at a different stage of the report, which means each is suited to different kinds of questions. This article explains what each option does, when to use it, how to open the expression editor to build one, and which functions are available for each.
Note: Access to this feature requires additional licensing.
Understanding the Three Options
| Property | Custom Dimension | Custom Measure | Table Calculation |
| Where it's calculated | Row by row | With aggregation | After the results are already returned |
| Aggregates rows? | No | Yes | No |
| Real Count Distinct? | No | Yes | No |
| Needs source field visible? | No | No | Yes |
| Typical use case | Tag each interaction with a "Duration Bucket" (Short/Medium/Long) based on its handle time, before any grouping happens. | Get the distinct count of Interaction IDs per Disposition. | Show each queue's calls as a % of total calls already displayed in the report. |
Reaching the Expression Editor in Talkdesk
All three calculation types are available in the same place: while creating or editing a custom report or dashboard in Explore. Once you're in edit mode, go to Custom Fields > + Add, then choose one of the following:
- Custom Dimension: Give it a name, then build your expression in the editor that opens.
- Custom Measure: Give it a name, choose the field(s) it should be based on, and build your expression.
- Table Calculation: Give it a name, then build your expression using the fields already present in your results.
Building an Expression
Every custom calculation is built using the same expression editor, which prompts you as you type:
- Seeing all suggestions. Type a space to see the full list of fields, functions, and operators you can use. It's a long list, so typing a few letters will narrow it down.
- Adding a field. Start typing a field's name and pick it from the list. The editor inserts it in the form ${view_name.field_name}, which uniquely identifies that field.
- Adding operators. Use logical operators (AND, OR, NOT), comparison operators (such as >, =, <=), and mathematical operators (such as + and *). Parentheses let you control the order in which they're evaluated.
- Adding functions. Start typing a function's name to see matching functions in the suggestion list. As you build the expression, the information pane to the right shows which arguments the function needs and what type they should be.
- Reading the hints. Parts of your expression that aren't valid yet are underlined in red, and the information pane explains why. This is the fastest way to fix an expression that isn't working.
Functions can be nested inside one another, as long as the result of the inner function matches the type of argument the outer function expects. For example, you could pull a date out of a field, calculate the difference in days from a fixed date, and then use mod to turn that into a day-of-week number - all in a single expression.
The sections below cover what's available for each of the three calculation types, since each one supports a different set of functions.
Custom Dimension
A Custom Dimension adds a new attribute to each row of raw data, calculated before any grouping or aggregation happens. Because it runs row by row, it can't look at other rows, and it can't produce a sum, count, or average. For that, you should use a Custom Measure.
Use Cases
- Bucketing a numeric field into readable categories (for example, grouping Handle Time into "Short," "Medium," and "Long")
- Cleaning up or reformatting a text field before it's displayed or grouped on
- Combining two fields into a single label, such as concatenating Queue and Disposition
- Flagging rows that meet a condition (Yes/No) so you can filter or group by that flag later
Functions Available
Because a Custom Dimension is evaluated one row at a time, it supports only functions that return a single-row result, not aggregate functions (like sum or count) and not functions that look at other rows or pivoted columns.
| Category | Examples | Purpose |
| Math | round, abs, ceiling, floor, mod, sqrt, power | Basic arithmetic and rounding on a single value |
| String | concat, contains, upper, lower, substring, replace, length | Combine, search, reformat, or trim text |
| Date | date, diff_days, add_days, extract_months, trunc_days, now | Build, compare, or extract parts of a date |
| Logical | if, case, coalesce, is_null, comparison operators (=, >, <=) | Branch logic and handle missing values |
Custom Measure
A Custom Measure creates a new aggregated metric (sum, count, average, distinct count, and so on) calculated across many rows of raw data. This is the only one of the three options that can produce a true aggregation, including a real distinct count, which isn't possible with a Table Calculation.
Use Cases
- Getting the distinct count of Interaction IDs per Disposition
- Calculating an average, median, or standard deviation across raw records instead of relying on a pre-built metric
- Summing a value only when a condition is met (for example, total talk time for calls longer than 5 minutes)
- Building a ratio of two aggregations, such as answered calls divided by total calls
Functions Available
A Custom Measure can use everything a Custom Dimension can, plus aggregate functions that reduce many rows into a single number.
| Category | Examples | Purpose |
| Aggregation | sum, count, count_distinct, average / mean, median, min, max | Reduce a column of raw values to a single result |
| Statistical | stddev_pop, stddev_samp, var_pop, var_samp, percentile | Measure spread and distribution across raw records |
| Row-level (same as Custom Dimension) | if, case, math and string functions | Shape or filter values before they're aggregated |
Table Calculation
A Table Calculation is computed after the report's results are already returned. It can only use the dimensions and measures already present in your result set (it cannot reach back into the underlying raw data) but it can combine, compare, or reposition those values, including totals, running values, and values from other rows or pivoted columns.
Use Cases
- Showing each row's value as a percentage of a column or row total
- Building a running total or running product down a column
- Comparing a value to the previous row (for example, week-over-week change)
- Ranking rows by a measure already in the table
- Pulling a value out of a specific pivoted column to compare against another
Functions Available
Table Calculations support the full function library — everything available to Custom Dimensions and Custom Measures, plus functions that only make sense once a result set already exists, such as reaching other rows, pivoted columns, or totals.
| Category | Examples | Purpose |
| Positional | offset, pivot_index, pivot_where | Pull a value from a different row or a specific pivoted column |
| Running / cumulative | running_total, running_product, rank, percent_rank | Track cumulative values or ranking across the result set |
| Totals | ${field:total}, ${field:row_total} | Reference the column or row total already shown in the report |
| Type conversion | to_number, to_string, to_date | Convert a value's type so it can be used with another function |
| Everything above | Math, string, date, logical, and aggregate functions | Same functions available to Custom Dimensions and Custom Measures |
For example, to show a field as a percentage of its column total:
$(contacts.total_time)/sum($(contacts.total_time))
Which One Should You Use?
- Need to tag or reshape data before it's grouped, with no aggregation involved? Use a Custom Dimension.
- Need a new aggregated number (especially a true distinct count), or a statistic across raw records? Use a Custom Measure.
- Already have the numbers you need in your results table, and just want to combine, compare, or reposition them? Use a Table Calculation.