Build / Widgets
Calculations
This page covers what a classic widget’s data layers calculate: the functions, how values are grouped, and how they compare over time. For where these settings sit in the editor, see Create a classic widget. Query Widgets calculate in SQL instead; see Query Widgets.
Each data layer works in this order: it reads its dataset, applies its filter, groups rows by its X axis, then runs its function on each group.
Functions
Section titled “Functions”Choose the function under Function & Axis on a layer’s Data tab. If the function needs a column, choose it in the On box.
| Function | What it returns | Needs a column |
|---|---|---|
| Row count | The number of rows that pass the layer’s filter. | No |
| Sum | The total of a column. | Yes |
| Average | The mean of a column. | Yes |
| Median | The middle value of a column. | Yes |
| Max | The largest value of a column. | Yes |
| Min | The smallest value of a column. | Yes |
| Mode | The most common value of a column. | Yes |
| Range | The difference between a column’s largest and smallest values. | Yes |
| Custom | A calculation you build from your own operations. | No |
| Percentage | The share of rows that also match a second filter. | No |
Table widgets don’t have a function: they show the layer’s rows. Dynamic Value widgets show one column, chosen in Value Column.
Custom
Section titled “Custom”Choose Custom, then click Configure to open Custom Calculation. Add the operations that produce your value and click Done. The button shows how many operations are set. The builder is the same one Modified Datasets use for calculated columns; see Modified Datasets.
Percentage
Section titled “Percentage”Choose Percentage, then on the Filter tab click Percentage Filter. In the Percent Filter dialog, build a filter for the rows you want to count and click Done.
The result is the number of rows that match the Percent Filter, divided by all rows that pass the layer’s own filter, times 100. The button shows Set or Not set.
For example, to show a lead conversion rate, filter the layer to all leads, then set the Percent Filter to leads whose status is Won.
Group by an X axis
Section titled “Group by an X axis”Charts group a layer’s rows by its X Axis column and calculate one value per group. Without an X axis, the layer calculates one total.
| Setting | What it does | Shown on |
|---|---|---|
| X Axis | The column to group by, such as a date, status or product. | Bar, Line, Pie, Matrix and Funnel |
| X Axis Delimiter (optional) | Splits a text value on this character, such as , or |, so a row with several values counts toward each. |
Layers with an X axis |
| Secondary X Axis | Groups each X axis value again by a second column. | Bar and Line |
| Secondary X Axis Delimiter (optional) | Splits the secondary column the same way. | Layers with a secondary X axis |
Rows with an empty date on a date X axis are left out.
Data layers per widget
Section titled “Data layers per widget”Add a layer with + next to Data Layers. Each layer can read a different dataset or use a different filter, so you can show several series or metrics in one widget.
| Widget | Data layers |
|---|---|
| Bar, Line, Pie, Matrix, Funnel | As many as you need |
| Gauge | Up to 2. The second is the Maximum Value layer. |
| Number, Table, Dynamic Value | 1 |
| Static Value, Image, External Website, Button | None |
Time and grouping
Section titled “Time and grouping”These settings are on the Data tab of Widget Settings, under Time & Grouping.
| Setting | What it does | Shown on |
|---|---|---|
| Time Increment | Groups a date X axis by Auto, Minute, Hour, Day, Week, Month, Quarter or Year. Auto picks one based on the date range. You can also change it from the clock in the widget footer. | Bar, Line, Pie, Funnel, Matrix |
| Use Fiscal Calendar | Uses your company’s fiscal periods for month, quarter and year boundaries. See below. | Bar and Line |
| Timezone | The timezone dates are grouped in. | Bar, Line, Pie, Funnel, Matrix |
| Grouping | Don’t Stack, or Stack by Axis Label to stack layers that share an X value. | Bar and Line |
Sorting and limits
Section titled “Sorting and limits”These are under Sorting & Limits on the same tab.
| Setting | What it does | Shown on |
|---|---|---|
| Sorting | Alphabetical, Reverse Alphabetical, Highest or Lowest. | Bar, Line, Pie, Funnel, Table, Matrix |
| Group By Sorting | The same choices, applied to grouped values. | Same |
| Value Limit | The most values to show. Combine with Highest for a top 10. | Same |
| Hide Zero Labels | Hides labels for values of 0. |
Bar, Line, Pie, Funnel |
| Drilldown Date Format | How dates appear in drilldown tables: Local, or a day, month and year order with or without the time. | Same as Sorting |
Comparisons
Section titled “Comparisons”The Compare group appears on Number, Bar and Line widgets.
| Setting | What it does |
|---|---|
| Compare With Previous Period | Previous Period compares with the period just before; Period Last Year compares with the same period a year earlier. |
| Compare Points | Shows the change between values. |
| Only Show In Label | Shows the change only in the label. |
| Comparison Type | Previous compares each point with the one before it. Custom compares with the Custom Comparison Value you enter. |
| Comparison Method | Percent for the percentage change, or Difference for the amount. |
Compare With Previous Period needs exactly one data layer, and that layer’s filter must use a date range or a date-range Filter Variable. Until then the group says so.
Fiscal calendar
Section titled “Fiscal calendar”If your company has a fiscal calendar, Use Fiscal Calendar appears on Number, Bar and Line widgets whose layer filters on a date range. On a Number widget it’s in the Compare group; on Bar and Line it’s under Time & Grouping.
With it on, month, quarter and year boundaries come from your fiscal periods. Previous Period steps back the same number of fiscal periods, and Period Last Year uses the matching periods in the prior fiscal year. Dates outside every fiscal period fall back to the normal calendar.