Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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

3 Replies
its_anandrjs

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

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