A dashboard widget almost never shows your raw data row by row. Instead, it aggregates your data at the level you have specified in the widget, which could be a single number or it could be by user or by course. Numeric columns such as “Number of Enrolments” can be aggregated, but text and date columns cannot.
If you’ve used a pivot table in Excel, you already know the idea. You choose what to group by (the rows) and what to calculate (the values), and Excel works out a total for each group. Widgets work the same way.
This page explains how that works, and how to avoid the most common reason dashboards show the wrong number: counting the same thing more than once.
How a widget turns many rows into one number
Widgets will have serval areas where you can add columns. These fall into two groups:
| Part of the widget | What it does | Excel pivot equivalent | Example |
| Rows, categories or break by | Splits the data into groups | Rows and columns | Course Name, User Location, Enrolment Completion Date (by month) |
| Values | Calculates one number for each group | Values | Number of Completed Enrolments, average score |
An Indicator has no groups, so it shows one number for all the data that’s left after filtering.
When you add a field to Values, the widget chooses an aggregation for you:
- Text and ID fields are counted. For example, adding User ID gives you the number of different users.
- Number fields are summed. For example, adding Score adds every score together.
You can change the aggregation by clicking the field name in Values. Always check which one is selected, because the default isn’t always the one you want. A total of everyone’s scores is rarely useful, for example, but an average is.
The aggregation menu on a Values field
Count vs Count All (DupCount)
There are two ways to count, and they can give very different answers.
- Count Unique counts each different value once. If the same value appears on several rows, it’s only counted once.
- Count All counts every row, including repeats. In a formula, this is written as DupCount.
Example. Sam completes a course twice, and Alex completes it once. Your data has three completion rows.
| User | Course | Completion date |
| Sam | Fire Safety | 3 March |
| Sam | Fire Safety | 9 September |
| Alex | Fire Safety | 12 May |
If you add User ID to a widget, the aggregation you choose changes the answer:
| You add | Aggregation | Result | What it answers |
| User ID | Count Unique | 2 | How many people completed Fire Safety? |
| User ID | Count All | 3 | How many times was Fire Safety completed? |
So, before you count, ask yourself whether you want how many people or items, or how many times something happened. Use “Count Unique” for the first and “Count All” for the second.
Sum, average, min and max
For number fields, you can choose how the numbers are combined.
| Aggregation | What it does | Good for |
| Sum | Adds all the values together | Total time spent, total number of launches |
| Average | Adds the values, then divides by how many there are | Average score, average time to complete |
| Min | Shows the smallest value | Earliest date, lowest score |
| Max | Shows the largest value | Latest date, highest score |
Some things to keep in mind:
- Don’t sum numbers that are already totals or percentages. Adding up five completion rates of 80% gives 400%, which means nothing. Calculate the percentage from the underlying counts instead. See Formulas, including percentages.
- Averages are only as good as the rows behind them. If a row is repeated (see below), it’s counted twice in the average too.
- Grand totals are worked out again from the data, not by adding up the rows you can see. If a person appears in two groups, they’re in both groups but only once in the total, so the rows may not add up to the total. This is expected when you use Count.
Avoiding double counting
Double counting happens when the same record appears on more than one row, so it’s added more than once. It’s the most common reason a dashboard shows a number that’s too high.
When it happens
- You put two unrelated measures in one widget. For example, Number of Course Launches and Number of Comments split by User Location. The two measures aren’t directly linked, so the numbers may be repeated or inflated.
- Your organisation keeps historical versions of users or content. If a person’s details have changed, for example they moved team, they may appear once for each team if you performed a unique count of users per team. Use the “Current Version” filter to only show the current version of the user or content record.
- Several items share the same name. If two courses have the same name, grouping by Course Name combines them into one row. Use the course alias or ID to keep them apart.
How to avoid it
- Count IDs, not names or dates, when you want distinct people or items.
- Keep one measure per widget, or link measures through a table they both join to, such as Enrolments.
- Filter Current Version to true when you want each person or course to appear once, with their current details.
- Group by a table your measure is linked to. If the numbers look the same on every row, or are far higher than expected, the table you’ve grouped by probably isn’t connected to your measure. See the “How to use it” page for your data model.
Use the pre-built measures where you can
If you use the LP Platform Analytics model, you don’t need to set up most counts yourself. Each Measures table includes ready-made count fields that already count the right thing, the right way. For example:
- Number of Completed Enrolments in Measures - Enrolment Completions
- Number of Course Launches in Measures - Course Launches
Start your widget from the measure that matches your question, then add fields from Users and Content to split or filter it. Only count IDs yourself when you need distinct people or items, such as the number of different users who launched a course.
If you use the xAPI model, most widgets count statements. Decide first whether you want the number of statements (Count All) or the number of different people or activities (Count on an ID field).
Quick checks before you trust a number
- Is it the right size? Compare it with something you know, such as the number of learners in a team or the number of enrolments on one course.
- Look at one example. Filter to a single person or course and check the number matches what you’d expect from the platform.
- Switch to a table. Turning a chart into a table shows you the rows behind the number, which makes repeats easy to spot.
Next steps
- Formulas, including percentages
- Setting up filters (primary, regular, background)
- Building widgets