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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
asknyldz
Contributor III
Contributor III

Average calculation

Hi there,

How can i calculate below table average by Segment.

It is must be,

  

Commercial1.50
Middle Market2.00
Risk Management1.50

This is my Expressions and table

count(distinct if(AMOUNT>0 AND TYPE='ACTUAL', SPECIALTY))

1 Solution

Accepted Solutions
devarasu07
Master II
Master II

Hi,

just add your client dimension

=Avg(Aggr(Count({<AMOUNT = {">0"}, TYPE = {'ACTUAL'}>}distinct SPECIALTY), SEGMENT,CLIENT))

for the total just enable total check box on your straight table --> dimension limit tab section.

Capture.JPG

View solution in original post

6 Replies
devarasu07
Master II
Master II

Hi,

Can u try like below,

=Avg(aggr(count(distinct if(AMOUNT>0 AND TYPE='ACTUAL', SPECIALTY)),SEGMENT))

or try other way simplified using set analysis method

=Avg(Aggr (count({$<AMOUNT={">0"}, TYPE={'ACTUAL'}>} distinct SPECIALTY),SEGMENT))

if still have a issue, share the mock data. thanks

also check this Hic article,

Average – Which average?

jonathandienst
Partner - Champion III
Partner - Champion III

Looks correct, but probably more efficient to use

=Avg(Aggr(Count({<AMOUNT = {">0"}, TYPE = {'ACTUAL'}>}distinct SPECIALTY), SEGMENT))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
big_dreams
Creator III
Creator III

can you provide sample data???

Regards,

devarasu07
Master II
Master II

Hi,

can your share your mock data in excel format? that would be easy for us to check and help you

devarasu07
Master II
Master II

Hi,

just add your client dimension

=Avg(Aggr(Count({<AMOUNT = {">0"}, TYPE = {'ACTUAL'}>}distinct SPECIALTY), SEGMENT,CLIENT))

for the total just enable total check box on your straight table --> dimension limit tab section.

Capture.JPG

asknyldz
Contributor III
Contributor III
Author

Thanks Devarasu