https://github.com/pocesar/actor-aggregate-fields
Aggregate all possible variations for the selected fields
https://github.com/pocesar/actor-aggregate-fields
Last synced: about 1 year ago
JSON representation
Aggregate all possible variations for the selected fields
- Host: GitHub
- URL: https://github.com/pocesar/actor-aggregate-fields
- Owner: pocesar
- License: apache-2.0
- Created: 2020-04-23T03:31:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-09T05:09:56.000Z (about 5 years ago)
- Last Synced: 2024-10-18T06:29:01.974Z (over 1 year ago)
- Language: JavaScript
- Size: 153 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aggregate fields
Create an overview of a dataset by aggregating the possible variations from the selected fields
Useful for checking the consistency of data used together with the [Results Checker actor](https://apify.com/lukaskrivka/results-checker)
## Usage
Dataset format
```json
[{
"type": "type-1",
"categories": [
"cat 1",
"cat 2"
],
"n": 1
},{
"type": "type-2",
"categories": [
"cat 4",
"cat 5"
],
"n": 2
}]
```
INPUT
```json
{
"datasetId": "defaultDatasetId",
"fields": [
"type",
"categories",
"n"
],
"split": {
"categories": " ",
"type": "-"
}
}
```
OUTPUT
```json
{
"categories": {
"values": [
"cat",
"1",
"2",
"4",
"5"
],
"count": 5,
"min": 1,
"max": 3,
"average": 2
},
"type": {
"values": [
"type",
"1",
"2"
],
"count": 3,
"min": 1,
"max": 4,
"average": 2
},
"n": {
"values": [
1,
2
],
"count": 2,
"min": 1,
"max": 2,
"average": 1
}
}
```
## License
Apache 2.0