Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AC
Contributor II
Contributor II

Average Calculation Issue in Pivot Table

I have an issue in calculating the average, so looking for some help here.

I would like to show avg counts per each day/week/month...etc insisted of total counts in the text boxes and Pivot table.

I am trying to match the avg counts from text box values with the Pivot table values (from the attached file) for that in Pivot table i have tried some expressions(along with dates trying to add Pivot tables dimensions as well) to match Avg Fleet/Rented  values with the text box values values, It is matching only when we select a particular day (Select a day from list box and see) but when you deselect the day or when you clear the selections avg text box values are not matching with Pivot table values.

Of-course it should match when we select Corp_BP_Type filter as well.

Second one is need to set up Document On Open trigger for Week and Quarter fields as like other date fields.

Regards,

Anil

1 Solution

Accepted Solutions
stabben23
Partner - Master
Partner - Master

Change to Date here instead of Day

=sum(aggr(avg(aggr(if(only(Vehicle_Use) = 'LEASE',
count({<Vehicle_Use-={''},Unit_type-={''},Current_Cust_Number ={'699999','699998'},Vehicle_FlagStatus_Group2 = {'AVAILABLE','RENTED','DEADLINED'},Veh_Cap_Status-={''}>}FLEET_COUNT),
count({<Vehicle_Use-={''},Unit_type-={''},Vehicle_FlagStatus_Group2 = {'AVAILABLE','RENTED','DEADLINED'},Veh_Cap_Status-={''}>}FLEET_COUNT)),Date,Corp_BP_Type,Unit_type)),Corp_BP_Type,Unit_type))

View solution in original post

5 Replies
AC
Contributor II
Contributor II
Author

Guys, Any help on my issue??

stabben23
Partner - Master
Partner - Master

Here is a New qvw

AC
Contributor II
Contributor II
Author

Thank you for the response Staffan. Its matching for Monthly,Week and Day but when clear the selections and when you select Quarter and Year its not matching. See belowCapture3.JPG

stabben23
Partner - Master
Partner - Master

Change to Date here instead of Day

=sum(aggr(avg(aggr(if(only(Vehicle_Use) = 'LEASE',
count({<Vehicle_Use-={''},Unit_type-={''},Current_Cust_Number ={'699999','699998'},Vehicle_FlagStatus_Group2 = {'AVAILABLE','RENTED','DEADLINED'},Veh_Cap_Status-={''}>}FLEET_COUNT),
count({<Vehicle_Use-={''},Unit_type-={''},Vehicle_FlagStatus_Group2 = {'AVAILABLE','RENTED','DEADLINED'},Veh_Cap_Status-={''}>}FLEET_COUNT)),Date,Corp_BP_Type,Unit_type)),Corp_BP_Type,Unit_type))

AC
Contributor II
Contributor II
Author

Thank you, now its working fine.