-
Notifications
You must be signed in to change notification settings - Fork 4
Aggregators
David Megginson edited this page Nov 16, 2018
·
3 revisions
An aggregator counts or calculates values in an output report generated by the Count rows filter. The HXL Proxy supports four types of aggregators (examples are the string encodings used by the JSON count rows filter encoding):
Aggregator | Parameters | Description | Example |
---|---|---|---|
count | (none) | Report the total number of rows in the original dataset for each combination values matching the count-filter patterns. | count() |
sum | tag pattern | For each column matching the tag pattern, report the sum (total) of all numeric values for each combination of count-filter patterns. | sum(#targeted) |
average | tag pattern | For each column matching the tag pattern, report the average (mean) of all numeric values for each combination of count-filter patterns (non-numeric cells are ignored). | average(#targeted+children) |
min | tag pattern | For each column matching the tag pattern, report the lowest of all numeric, date, or lexical values for each combination of count-filter patterns (non-numeric cells are ignored). | min(#date+start) |
max | tag pattern | For each column matching the tag pattern, report the lowest of all numeric, date, or lexical values for each combination of count-filter patterns (non-numeric cells are ignored). | max(#value+cost) |
concat | tag pattern | For each column matching the tag pattern, join all unique values together, separated by " | " and sorted into lexical order. Normalises whitespace but preserves character case. |
When specifying an aggregator using a string (e.g. in a JSON recipe), you can optionally provide a text header and HXL hashtag for the output column following " as ".
Use default output hashtag:
sum(targeted)
Specify hashtag but not header:
sum(targeted) as #targeted+total
Specify hashtag and header:
sum(targeted) as Total targeted#targeted+total
Learn more about the HXL standard at http://hxlstandard.org