These are aggregate functions as available on stream views and pipes. Aggregate functions serve the purpose of aggregating data and giving it more eaningfull meaning. They are usually a common feature in any data based environment. In database management, for instance aggregate functions are used where multiple rows are grouped together to form a singe value or to find out more significant meaning, represented by a single value on a set of values.
Aggregate functions are also available on pipes and views in PhixFlow. The following composes a set of available functions:
Function | Description |
---|
average | |
maximum | |
minimum | |
sum | |
percent | |
distinct | |
count | |
...
Insert excerpt |
---|
| _Banners |
---|
| _Banners |
---|
name | analysis |
---|
nopanel | true |
---|
|
Overview
Aggregate functions, often grouped by other attributes, give totals, max, min, average values etc. for each key value they are provided. For example, you can sum the amount of all the lines on an invoice based on an invoice number.
Aggregate functions are available to use on Views and Pipes.
Aggregating with a Pipe
To configure a pipe for aggregation
- Click on a pipe to open its properties.
- In the Aggregate Attributes section, click the plus button to add a new attribute.
- Complete the details:
- A Function: select the function you wish to perform e.g. sum. A complete list is provided in the function section at the end of this page.
- Attribute: select the attribute you wish to perform the function on.
- Name: name your new attribute.
- Aggregation on a pipe takes place across all groups of data. Therefore you can define which attribute(s) you wish to group on by adding these to sort/group, or if no grouping is provided aggregation takes place across all records.
- Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
to save your changes. - The table connected to the end of the pipe can now access your attribute using its name.
Note |
---|
You cannot refer to any attributes in the source table for which there is no grouping or aggregate attribute. |
Aggregating with a Table
- Click on the pipe connecting to an Aggregate Table to open its properties.
- Aggregation takes place across all groups of data. Therefore you can define which attribute(s) you wish to group on by adding these to Sort/Group, or if no grouping is provided aggregation takes place across all records.
- Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
to save your changes. - The Aggregate Table has access to all attributes on the incoming pipe.
- In the Attribute expressions,
- Use functions to aggregate values e.g. sum(in.Amount) will sum up all amounts within a group.
- Where multiple values exist for a group they will be treated as an array.
Use a full stop suffix after the attribute name followed by a number to obtain the record from a group in that position.
For example in.Name.1 will take the first name in a group.
Alternatively, use the Functions built into PhixFlow to select the required value.
Aggregate Examples
See Using an Aggregate Table.
Aggregate Functions
For the aggregate functions, Cumulative Sum and Cumulative Percent, see View Attribute.
Insert excerpt |
---|
| Aggregating Data |
---|
| Aggregating Data |
---|
nopanel | true |
---|
|