Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
malradi88
Creator II
Creator II

Average KPI vs Average shown in Bar Chart

Dear Qlik Community,

I hope this finds you well. I am using the following expression in a KPI to calculate the average earnings of an embroiderer:

avg(aggr(avg({< DateType = {'Date Returned'}>}[Fees paid to embroiderer]), [I.D. #],DateType= 'Date Returned'))

This expression is giving correct results when in a KPI visualisation (The [I.D. #] field represents the worker ID and 'DateType' when they return a product to the company and get paid).


However when I put that expression in a bar chart with 'month' as a dimension the results are incorrect. The strange thing though is when I click on a certain month the average in the bar chart changes and becomes correct (e.g. if i click on December the bar for December suddenly matches he KPI result...but December on its own, before pressing the filter shows an incorrect result).


I can't seem to figure out why he bar chart shows incorrect results until I filter for a specific month. Any help would be much appreciated

Thank you for your support.

Best,

Mohammed

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

aggr function is disregarding chart dimenision

so you need to add the month to the function

avg(aggr(avg({< DateType = {'Date Returned'}>}[Fees paid to embroiderer]), [I.D. #],DateType= 'Date Returned',month))

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

aggr function is disregarding chart dimenision

so you need to add the month to the function

avg(aggr(avg({< DateType = {'Date Returned'}>}[Fees paid to embroiderer]), [I.D. #],DateType= 'Date Returned',month))

malradi88
Creator II
Creator II
Author

Thank you Liron!