Widget Calculations
Calculations define how your widget aggregates and displays data. In the widget editor, you’ll configure these using the Function dropdown.
Understanding calculations
Section titled “Understanding calculations”Each data layer performs a calculation that transforms raw data into displayed values.
Calculation flow
Section titled “Calculation flow”Dataset → Filter → Group → Aggregate → Display- Dataset: Select your data source
- Filter: Optionally limit which records to include
- Group: Optionally categorize by a column (X-Axis)
- Aggregate: Summarize into values using a function
- Display: Show in the widget
Standard function types
Section titled “Standard function types”These are available for most data visualization widgets. Select them from the Function dropdown in the data layer settings.
Count aggregations
Section titled “Count aggregations”| Type | Description | Example |
|---|---|---|
| Row Count | Number of records in dataset | Total tickets, Customer count |
Numeric aggregations
Section titled “Numeric aggregations”| Type | Description | Example |
|---|---|---|
| Sum | Total of all values | Total revenue, Hours worked |
| Average | Mean value | Average ticket time, Avg order value |
| Median | Middle value (50th percentile) | Median salary, Median response time |
| Mode | Most common value | Most frequent status, Common category |
| Max | Largest value | Maximum order, Highest price |
| Min | Smallest value | Minimum price, Lowest inventory |
| Range | Difference between max and min | Price spread, Time range |
Advanced functions
Section titled “Advanced functions”| Type | Description | Use case |
|---|---|---|
| Custom | Create your own formula | Complex metrics, weighted averages |
| Percentage | Percentage matching a filter | Conversion rate, Success rate |
Function requirements
Section titled “Function requirements”Column requirements
Section titled “Column requirements”Some functions require a specific column (set via Computation Column):
| Function | Requires column | Column type |
|---|---|---|
| Row Count | No | N/A |
| Sum | Yes | Numeric |
| Average | Yes | Numeric |
| Median | Yes | Numeric |
| Max | Yes | Numeric, Date, Text |
| Min | Yes | Numeric, Date, Text |
| Mode | Yes | Any |
| Range | Yes | Numeric |
| Custom | No | N/A |
| Percentage | No | N/A |
Data type compatibility
Section titled “Data type compatibility”Numeric columns support all calculations.
Date columns support: Row Count, Max (latest), Min (earliest)
Text columns support: Row Count, Max, Min, Mode
Creating calculations
Section titled “Creating calculations”Step 1: Add a data layer
Section titled “Step 1: Add a data layer”- In the widget editor, make sure you’re on a data visualization widget
- Data layers appear in the left panel under “Data Layers”
- Click + Add Data Layer for additional calculations
- Each layer can have its own dataset and function
Step 2: Select dataset
Section titled “Step 2: Select dataset”- In the data layer settings on the right, find the Dataset field
- Choose from available datasets or modified datasets
- Columns load automatically
Step 3: Configure function
Section titled “Step 3: Configure function”- Enter a Layer Name for the data layer
- Select the Function type (Row Count, Sum, Average, etc.)
- If required, select the Computation Column
- Configure additional options like X-Axis
Filtering data
Section titled “Filtering data”Apply filters to limit which records are included.
Adding filters
Section titled “Adding filters”Use the Filter Builder for precise logic:
- In the data layer config, click Filter
- A filter popover opens
- Define conditions using columns, operators, and values
- Group conditions with AND/OR logic
For complete details, see Filtering Data.
Filter logic
Section titled “Filter logic”- Groups: Nest conditions for complex logic (e.g.,
(A OR B) AND C) - Dynamic Values: Compare against other columns or Dashboard Filter Variables
- Date Logic: Use relative ranges like “Last 30 Days” or “Start of This Month”
Date filters
Section titled “Date filters”Special options for date filtering:
| Filter | Description |
|---|---|
| Today | Current date |
| This Week | Current week |
| This Month | Current month |
| This Quarter | Current quarter |
| This Year | Current year |
| Last N Days | Rolling window |
| Date Range | Specific start/end dates |
| Filter Variable | Use dashboard filter |
Grouping data
Section titled “Grouping data”Groupings break down calculations by category.
Setting the X-Axis (Group By)
Section titled “Setting the X-Axis (Group By)”For chart widgets, the X-Axis determines how data is grouped:
- Select a column for the X Axis field
- The calculation runs for each unique value
- Results display as separate bars, lines, or pie slices
Splitting X-axis values with delimiters
Section titled “Splitting X-axis values with delimiters”Bar and line charts can split a single text value into multiple X-axis categories.
- Select an X Axis column in the data layer
- Enter a character in X Axis Delimiter (optional), such as
,or| - If the column contains multiple values in one field, the widget splits them into separate categories
If your chart uses Secondary X Axis, you can also set Secondary X Axis Delimiter (optional) to split that field the same way.
Blank, empty, and literal null values on category-based X-axes display as Blank in the chart and drilldown instead of being skipped.
Grouping examples
Section titled “Grouping examples”| X-Axis selection | Result |
|---|---|
| None (no X-axis) | Single total value |
| Product column | Value per product |
| Date column | Value over time |
| Status column | Value per status |
Date groupings
Section titled “Date groupings”When using date columns as X-axis, choose time increments:
| Increment | Example output |
|---|---|
| Minute | 2024-01-15 14:30 |
| Hour | 2024-01-15 14:00 |
| Day | 2024-01-15 |
| Week | 2024-W03 |
| Month | January 2024 |
| Quarter | Q1 2024 |
| Year | 2024 |
Custom calculations
Section titled “Custom calculations”Create custom metrics using the Custom function type.
Building custom formulas
Section titled “Building custom formulas”- Select Custom as the function type
- Open the Custom Calculation Editor
- Build formulas using columns and operations
Available operations
Section titled “Available operations”- Arithmetic: Add, subtract, multiply, divide
- Functions: ABS, ROUND, CEIL, FLOOR
- Conditionals: IF statements
- String: Concatenate, substring, length
Example custom calculations
Section titled “Example custom calculations”[Revenue] - [Cost] // Profit[Revenue] / [Quantity] // Average price[Price] * 1.1 // Price with 10% markupIF([Status] = "Closed", 1, 0) // Closed count[Amount] / [Total] * 100 // Percentage of totalPercentage calculations
Section titled “Percentage calculations”Calculate what percentage of records meet specific conditions.
How it works
Section titled “How it works”- Select Percentage as the function type
- Configure the Primary Filter (denominator)
- Configure the Percentage Filter (numerator)
- Result: (Matching records / Total records) x 100
Example
Section titled “Example”Conversion rate calculation:
- Primary Filter: All leads (status is not null)
- Secondary Filter: Converted leads (status = “Won”)
- Result: Percentage of leads that converted
Multiple data layers
Section titled “Multiple data layers”Widgets can contain multiple calculations for richer visualizations.
Widgets supporting multiple layers
Section titled “Widgets supporting multiple layers”| Widget | Multiple layers support |
|---|---|
| Bar Chart | Yes - compare multiple series |
| Line Chart | Yes - overlay multiple trends |
| Pie Chart | Yes - compare datasets |
| Matrix | Yes - show multiple metrics |
| Funnel | Yes - compare funnels |
| Number | No - single value only |
| Gauge | Yes - up to 2 layers (current value + dynamic max) |
| Table | No - single dataset only |
Adding multiple layers
Section titled “Adding multiple layers”- Configure your first data layer
- Click Add Data Layer
- Select a different dataset or apply different filters
- Configure the second calculation
- Repeat as needed
Use cases
Section titled “Use cases”- Bar Chart: Compare revenue vs. target per product
- Line Chart: Show this year vs. last year trends
- Pie Chart: Compare market share across regions
- Matrix: Display multiple KPIs per employee
Standard vs. snapshot widgets
Section titled “Standard vs. snapshot widgets”Standard widgets
Section titled “Standard widgets”- Display current state of your data
- Update in real-time as data changes
- Good for: Live dashboards, current metrics
Snapshot widgets (Professional+)
Section titled “Snapshot widgets (Professional+)”- Record values over time at scheduled intervals
- Enable historical trend analysis
- More resource-intensive but tracks changes
- Good for: Trend reports, historical comparisons
When to use each
Section titled “When to use each”Use Standard when:
- You need live, current data
- Your source system tracks history
- Performance is critical
Use Snapshot when:
- Your source doesn’t store historical data
- You need to track changes over time
- You’re building trend reports
Troubleshooting
Section titled “Troubleshooting”Unexpected results
Section titled “Unexpected results”- Verify the correct column is selected
- Check filter conditions are correct
- Confirm aggregation type matches your intent
- Review grouping (X-axis) settings
Null values
Section titled “Null values”- Null values are excluded from most aggregations
- Use “Row Count” for total rows including nulls
- Use “Min/Max” to check for null date ranges
Duplicate counts
Section titled “Duplicate counts”- Check for duplicate records in source data
- Use appropriate grouping
- Verify filters aren’t creating overlaps