Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Avg function not working as expected

Hi everyone,

I have some problems with my expression with the Avg funtion in it.

My formula is: Avg(Aggr([1],[2],[3],[4],[5],[6],[7],[8],[9],[10]))

And it shows an output value but it's not correctly.

I have also some statistic objects which calculates the average of a column and I think that's working fine but in my KPI it's not.

When using a calculator and calculate the average of the statistic object I have another output then my KPI is showing.

Please see the attachment to clear some things up.

The 3 KPI's have all 3 groups of columns(answers) you can see on the right side.

Please ask me if you need further info or another screenshot, thanks a lot!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Try Below,

RangeAvg(Avg([1]),Avg([2]),Avg([3]),Avg([4]),Avg([5]),Avg([6]),Avg([7]),Avg([8]),Avg([9]),Avg([10]))

Or

RangeAvg(Sum([1]),Sum([2]),Sum([3]),Sum([4]),Sum([5]),Sum([6]),Sum([7]),Sum([8]),Sum([9]),Sum([10]))

View solution in original post

8 Replies
tresesco
MVP
MVP

Is it a chart or text box you are writing this expression in? If chart, which chart? what are the dimensions?

Not applicable
Author

Hi

AGgr function is similar to SQL group by, so you have to a dimension that you r grouping by

thanks

padma

Not applicable
Author

Thanks for the quick reply, I'm using this in the gauge chart and have no dimensions defined.

Not applicable
Author

Thanks for your reply.

So I have to add a group in the dimension tab?

Like this:

Group.jpg

Not applicable
Author

Hi

is it possible to have sample qvw

regards

padma

Not applicable
Author

Sure, see attachment.

Anonymous
Not applicable
Author

Try Below,

RangeAvg(Avg([1]),Avg([2]),Avg([3]),Avg([4]),Avg([5]),Avg([6]),Avg([7]),Avg([8]),Avg([9]),Avg([10]))

Or

RangeAvg(Sum([1]),Sum([2]),Sum([3]),Sum([4]),Sum([5]),Sum([6]),Sum([7]),Sum([8]),Sum([9]),Sum([10]))

Not applicable
Author

It works exactly like I wanted.

Thanks a lot!