Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ozcano
Contributor III
Contributor III

Taking Average in a pivot table

Hello

I have a pivot table as in the in the following picture. It shows the number of items (inventory) in each OrdererStoreCode (branch). What I want to do is compare this inventory numbers with average inventory per store. For example for ItemCode Samsung, I want to get (4+8+12)/3=8, then I will compare each store number with this average in each cell and than change color of cell accordingly (below, above average etc.). Up to now I could not get that average. How can I do that?

 

ozcano_0-1707119711967.png

 

Labels (3)
1 Solution

Accepted Solutions
jochem_zw
Partner Ambassador
Partner Ambassador

use avg(Value) as the measure expression

and use 

if(avg(Value)<Avg(total <ItemCode> Value),lightred(),green()) 

as your expression background color

View solution in original post

1 Reply
jochem_zw
Partner Ambassador
Partner Ambassador

use avg(Value) as the measure expression

and use 

if(avg(Value)<Avg(total <ItemCode> Value),lightred(),green()) 

as your expression background color