GROUPAVERAGE

GROUPAVERAGE

Syntax

GROUPAVERAGE(<number>)

Description

Returns the average value of a group by creating a sum for all values in the group and dividing by the number of values. A GROUPBY() function must first be used in order to then find the average arguments of another column in relation to it. The value of the GROUPAVERAGE() must be a number and is returned as a float

Empty or <null> records of a group aren't calculated into GROUPAVERAGE().

Calculating a column with a (or multiple) <error> records always returns an error for its group.

This is an aggregate function

Example

Given the following data set:

user_screen_name

user_follower_count

user_friend_count

user_time_zone

user_screen_name

user_follower_count

user_friend_count

user_time_zone

ArteWorks_SEO

2605

345

Central Time (US & Canada)

evan_b

460

316

Pacific Time (US & Canada)

briancoffee

185

321

London

PhillisGene

280

<null>

London

SsReyes

4

4

Pacific Time (US & Canada)

addztickets

291

0

Central Time (US & Canada)

mynossseee

190

94

Melbourne

AprilBraswell

14206

14082

Pacific Time (US & Canada)

bebacklatersoon

234

103

Sydney

nicolebaker76

7

27

Alaska

RNIHA

9

3

London

Object5

512

<error>

Melbourne

tman2088

108

155

Central Time (US & Canada)

First create a group, e.g. GROUPBY(#RawData!user_time_zone)

user_time_zone

user_time_zone

Alaska

Central Time (US & Canada)

London

Melbourne

Pacific Time (US & Canada)

Sydney

Then use the GROUPAVERAGE(#RawData!user_friends_count), and the average value of the arguments of that column appears in relation to the GROUPBY() column.

user_time_zone

GROUPAVERAGE returns

user_time_zone

GROUPAVERAGE returns

Alaska

27

Central Time (US & Canada)

166.6666667

London

162

Melbourne

<error>

Pacific Time (US & Canada)

4800.666667

Sydney

27