Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Average without a Max and min value in Aggregation

Hi all

I have this:

ProductoPRECIOTIENDA
1101
1311
141
121
241
271
251
2101
152
1102
1152
2102
2202
2202
2302

I would like to have the average for each "TIENDA" and "PRODUCTO" without the max and the min value for each agregation.

TIENDA 1:     PRODUCTO 1     AVERAGE 17.5

TIENDA 1:     PRODUCTO 2     AVERAGE 6

TIENDA 2:     PRODUCTO 1     AVERAGE 10

TIENDA 2:     PRODUCTO 2     AVERAGE 20

I'm going to use in a expression of a simple table chart using TIENDA as dimension

I need Helpppppppppppp .... I'll pay you a beer ..... or two

Regards

M

17 Replies
Anil_Babu_Samineni

First one Average is 11.5 ??? or 17.5 ???

May be this?

Create Straight Table and dimensions are Tienda, Producto

Expression simple Avg(PRECIO)

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

I need Helpppppppppppp .... I'll pay you a beer ..... or two

Hahaha, Don't offer only for Beer. Why not deposit amount to my bank ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shiveshsingh
Master
Master

Take Avg function as expression.

tienda and producto as dimension.

Capture.JPG

Anonymous
Not applicable
Author

HI all

Maybe I explained bad...

I would like to have the average of PRECIO in  every cross of TIENDA and PRODUCTO excluding the maxim and minimun value for each cross.

The result I post was what I want .... then mean for TIENDA 1:     PRODUCTO 1     AVERAGE 17.5 is because for this cross I don't use 10 (is the max) and  2 (is the minimum)

Regards

M

Anil_Babu_Samineni

Got it, But here again i doubt whether how you say 10 is Maximum. seems 31 is Max for you? and 2 is minimum. You need to exclude these but output should come 7 only. Please help me to figure out this?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

check this? It may helps you

Sum(Aggr(Avg({<PRECIO -= {'$(=Max(PRECIO))', '$(=Min(PRECIO))'}>} PRECIO), Producto, TIENDA))

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

HI Anil

Thanks for all

I'll give you more information ... in our chart the unique dimension is "TIENDA", not "PRODUCTO", we want that the result be the sum of the average of "PRECIOS" for every "PRODUCTO"excluding MAx an MIn of each "PRODUCTO".

The result should be:

average excluding (MIN Max) PRODUCTO1 TIENDA 1 = 17.5

average excluding (MIN Max) PRODUCTO2 TIENDA 1 = 6

SUM=23.5

average excluding (MIN Max) PRODUCTO1 TIENDA 2 = 10

average excluding (MIN Max) PRODUCTO2 TIENDA 2 = 20

SUM=30

 

TIENDARESULT
123.5
230

thank you very much

M

Anil_Babu_Samineni

Finally point from my end - How 17.5 Comes into the picture?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Sorry .... my fault ... i GIVE YOU BAD THE AVERAGE ... in resume

we have 4 PRECIOS for PRODUCTO 1,

10, 31, 4 y 2

The mean excluding the max and in value is (10+4)/2 = 7

SORRYYYYYY

REGARDS

M.