Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Venkatsj
Contributor III
Contributor III

Average for each Function - Bar graph

Hi I have a table as shown below where Function is A,B, C and Value is 1 to 10.

I wanted to create a bar graph where dimension is A, B, C and i want the measure to be average of each function.

I am getting error where for A,B,C i am getting the total average of the entire function as 5.5.  But the graph i am looking for is A=1.5, B= 4.5, C= 8.5. Kindly help me with the expression, Thanks. 

Function    Value

A 1
A 2
B 3
B 4
B 5
B 6
C 7
C 8
C 9
C 10
Labels (2)
6 Replies
Or
MVP
MVP

This seems as simple as it gets - use Function as the dimension and avg(Value) as the measure. Is this not the case for some reason?

Venkatsj
Contributor III
Contributor III
Author

Hi, I've used that but for some reason all the function in the graph getting same avg as 5.5 which is not correct. 

Or
MVP
MVP

I'd suggest you check your data model. It sounds like it may be different from what you described in your post, with Function and Value not actually being connected.

Venkatsj
Contributor III
Contributor III
Author

Its correct whatever I've mentioned in the post. 

Venkatsj
Contributor III
Contributor III
Author

Venkatsj_0-1694005491506.png

See here the value, Also see the measure which I've used. 

Or
MVP
MVP

I can only assume it isn't, because if it was, you'd get the correct behavior.

Or_0-1694005671435.png

Load * INLINE [
Function, Value
A, 1
A, 2
B, 3
B, 4
B, 5
B, 6
C, 7
C, 8
C, 9
C, 10];