Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
pavoodan123
Contributor
Contributor

average of aggregate function of a field shows mismatch in table and KPI- Qliksense

RevnPerDay =(Total Revenue of a vehicle/ Total service days of a vehicle)

ServLifeTimeinDays= Total service days of a vehicle

I have 2 measures:

1.Revenue per Model= avg(aggr(nodistinct avg({1} RevnPerDay), Model))      --->To avg revenue per day for that vehicle's Model

2.Average days per Model=avg(aggr(nodistinct avg({1} ServLifeTimeinDays), Model)) -- > to get avg service days for that vehicle's model.

Target revenue for a vehicle= Revenue per model * avg days per model

Expanded---> [

Target revenue for a vehicle= avg(aggr(nodistinct avg({1} RevnPerDay), Model)) * avg(aggr(nodistinct avg({1} ServLifeTimeinDays), Model))

                             ]

Revenue per model avg days per model Target Revenue Model
(AVG)     63.62427221 (AVG)  479.7551341 (AVG)  30704.40307  
67.39077237 527.6329563 35557.59245 Model 1
59.85777205 431.8773118 25851.21368 Model 2

In KPI it shows value "30,524.07" --->> 30,524.07= 67.39*479.75       (1st and 2nd  columns-above table).

I don't want like this in KPI , i want the value 30704.40 to be shown in KPI too. 

 

 

 

Please help.

 

 

 

Labels (4)
1 Solution

Accepted Solutions
pavoodan123
Contributor
Contributor
Author

found the solution. The table takes row by row average. So to do as same in KPI do aggregate of vehicle. it will work same as table.

solution:

avg({1}aggr( avg(aggr(nodistinct avg({1} RevnPerDay), Model))*(avg(aggr(nodistinct avg({1} ServLifeTimeinDays), Model))) ,Vin_No))

View solution in original post

2 Replies
pavoodan123
Contributor
Contributor
Author

found the solution. The table takes row by row average. So to do as same in KPI do aggregate of vehicle. it will work same as table.

solution:

avg({1}aggr( avg(aggr(nodistinct avg({1} RevnPerDay), Model))*(avg(aggr(nodistinct avg({1} ServLifeTimeinDays), Model))) ,Vin_No))

Ahidhar
Creator III
Creator III

Use this 

avg(aggr(avg(aggr(nodistinct avg({1} RevnPerDay), Model)) * avg(aggr(nodistinct avg({1} ServLifeTimeinDays), Model)),Model))