Frequently Asked Question
Symptom
- Know the difference between "Global average" and "Distinct average" aggregation function in the Drillbar
Environment
- Linux/Windows Server
- Need4Viz : versions >= 2023.2.1
Resolution
Three different aggregation functions can be used in the Drillbar. The default calculation is the sum (each value will be sumed on each level of dimension). But you can also use an average calculation.
There are two average calculation functions available : the "Global average" and the "Distinct average".
To explain the difference between the two functions, we will take a dataset sample, based in eFashion universe, so you can easily reproduce it on your own environment :
- Build a Webi table with "State", "Lines" and "Year" dimensions and the "Quantity sold" measure
- Add a break on the "State" and a second break on the "Lines" object
- Create a Webi variable "Average distinct" =Sum([Quantity sold])/Count([Year])
- Create a Webi variable "Average global" =Sum([Quantity sold])/Count([Year];All)
- Put the "Average distinct" & "Average global" variables in the footer of the "Lines" break
The result is the following one :
....
Now if you insert a N4V Drillbar element using the same Webi objects :
The default calculation used is the sum (of "Quantity sold", by "Year", "Lines" and "State") :
Here, the sum of "Quantity sold" for California is 46.074 and correspond to the Webi calculation :
1/ Global average
In the "Extended parameters" / "Calculation" / "Aggregation", choose the "Global average" function :
The result will be the following :
For California, the calculation done by the engine correspond to the "Average global" Webi variable : Sum of "Quantity sold" (=46.074) divided by the total number of values of lower level dimensions - "Year" (=65) => 708.83
2/ Distinct average
In the "Extended parameters" / "Calculation" / "Aggregation", choose the "Distinct average" function :
The result will be the following :
For California, the calculation done by the engine correspond to the "Average distinct" Webi variable : Sum of "Quantity sold" (=46.074) divided by the total number of distinct values of lower level dimensions - "Year" (=6) => 7.679