Date: Sun, 19 Sep 2021 19:45:03 +0000 (GMT) Message-ID: <333128447.3675.1632080703301@9c5033e110b2> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3674_1755640640.1632080703301" ------=_Part_3674_1755640640.1632080703301 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Aggregate Functions

# Aggregate Functions

Aggregate functions perform a computation against a set of val= ues to generate a single result. For example, you could use an aggregate fu= nction to compute the average (mean) order over a period of time. Aggregati= ons can be applied as standard functions or used as part of a transformatio= n step to reshape the data.

Aggregate across an entire colu= mn:

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>New formula `Single row formula` `average(Scores)`
=20

Output: Generates a new column containing the aver= age of all values in the `Scores` column.

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20
Transformation Name `Pivot columns` `average(Score)` `1`
=20

Output: Generates a single-column table with a sin= gle value, which contains the average of all values in the ```Score= s``` column. The limit defines the maximum number of columns that can b= e generated.

NOTE: When aggregate functions are applied as part of a= pivot transformation, they typically involve multiple parameters as part o= f an operation to reshape the dataset. See below.

Aggregate across groups of values within a column:

Aggregate functions can be used with the pivot transformation = ;to change the structure of your data. Example:

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20
Transformation Name `Pivot columns` `StudentId` `average(Score)` `1`
=20

In the above instance, the resulting dataset contains two columns:

• `studentId` - one row for each distinct student ID valu= e
• `average_Scores` - average score by each student (```stud= entId```)

NOTE: You cannot use aggregate functions inside of cond= itionals that evaluate to `true` or `false`.

A pivot transformation can include multiple aggregate = functions and group columns from the pre-aggregate dataset.