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: 
canmarroig
Partner - Creator
Partner - Creator

Average excluding selection

Hi, this is my data set

A     B         $

20    black    200

20    red       1000

30    white    10

70    blue      200

80    blue      300

90    blue      100

93    black     50

95    red        100

..........

i've a bar chart with my $ and i need to calculate avg of $ using A and B as dimension. No problem

Sales department (who hates me) asks to add a futher field with an avg for all A field with the same B field and if i select A=70 my average must be calculate without selected (80 blue + 90 blue).

Help me pls, tks

1 Solution

Accepted Solutions
sunny_talwar

May be one of the two:

Capture.PNG

1) Avg({<A, B = p(B)>} Dol)

2) Avg({<A = e(A), B = p(B)>} Dol)

View solution in original post

10 Replies
sunny_talwar

May be this:

Avg({<A, B = p(B)>}$)

t_chetirbok
Creator III
Creator III

hi!

if you select A=70, then result must be like this?

canmarroig
Partner - Creator
Partner - Creator
Author

No Tatsiana, my result must be:

80     blue

90     blue

t_chetirbok
Creator III
Creator III

I think Sunny ' s result is correct, isn't it?

canmarroig
Partner - Creator
Partner - Creator
Author

Perhaps this: Avg({<A=e(A), B=p(B)>}$)  but I've always to select an A dimension to obtain result.

sunny_talwar

May be one of the two:

Capture.PNG

1) Avg({<A, B = p(B)>} Dol)

2) Avg({<A = e(A), B = p(B)>} Dol)

tresesco
MVP
MVP

Like this?

Untitled.png

sunny_talwar

tresesco‌ what expression are you using?

tresesco
MVP
MVP

Avg({<A, B = p(B)>-<A=p(A)>}Dollar)

Equivalent to yours.