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: 
Not applicable

Using AGGR & AVG Function in Set Analysis

Hi :

Could some one help me,

if I need to use the following expression by substituting the SUM function with AVG

AGGR(NODISTICT(SUM({<PERIOD={$(=MAX(PERIOD))},YEAR={$(=MAX(YEAR))}>}  Amount))), Category, Class)

when I tried using with AVG function the resulting number is erroneous and does not give the average.

Appreciate in advance any help that can be extended

Kumar

Labels (1)
3 Replies
its_anandrjs
Champion III
Champion III

Hi,

You could write a script like

=AGGR(NODISTINCT SUM({<PERIOD={$(=MAX(PERIOD))},YEAR={$(=MAX(YEAR))}>} Amount), Category, Class)

Hope this helps

Thanks & Regards

its_anandrjs
Champion III
Champion III

Hi,

Try for avg script like

=Avg( AGGR( NODISTINCT SUM({<PERIOD={$(=MAX(PERIOD))}, YEAR={$(=MAX(YEAR))}   >}Amount), Category, Class))

Hope this helps

Thanks & Regards

Not applicable
Author

Hi, thanks Anand , but the result gives error in calculation