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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

May be one of the two:

Capture.PNG

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

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

tresB
Champion III
Champion III

Like this?

Untitled.png

sunny_talwar
MVP
MVP

tresesco‌ what expression are you using?

tresB
Champion III
Champion III

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

Equivalent to yours.