How do I Calculating Average of Unique Items Per Employee in a Data Source
In some cases, you may need to calculate the average of unique items per employee from a data source. This can be achieved by using expressions and widgets in your dashboard. Here’s how to do it:
Step 1: Create Expressions
First, you need to create two expressions. One for counting the number of employees and another for calculating the average of items based on the employee count.
- Expression for Count:
COUNTD([employee])
- Expression for Average:
SUM([item])/[employeeCount]
Step 2: Add a Combo Box Widget
Next, add a combo box widget to your dashboard. This widget will be used to filter based on the passed date values and the average. Assign the pivot grid and card widgets as its listeners.
Step 3: Use Card and Pivot Grid Widgets
The card widget will display the average items based on the employee count for a specific date, while the pivot grid widgets will show the employee and their total items purchased on that date.
Note: This expression can be supported by any data source that stores numerical data and allows mathematical operations, such as databases (like MS SQL, Oracle, PostgreSQL).