aggregate
aggregate: mean, sum, min, max or count over the last last rows of the task task that where keeps. where is an expression over the row's own fields, such as lead_days == 3 and precipitation > 0; without it every row counts. count counts rows and takes no path; the others read the number at path. A reading looks back through the rows the task keeps (its history) until last rows are kept, and takes the rows there are when where keeps fewer.
Use it for a mean, sum, minimum, maximum or count over earlier records of another task.
Keys
| Key | Type | Default |
|---|---|---|
gen |
aggregate |
required |
task |
text | required |
path |
text | none |
last |
integer | required |
function |
mean or sum or min or max or count |
required |
where |
text | none |
Every kind also accepts null_rate, unique, omit_rate and omit_when, which Generators describes.
Example
Three readings start at time 0. Each order publishes the mean of the last 3 levels. An order starts every 60 seconds for 200 seconds, with the seed 42, so three orders start.
All three print the same records:
JSON Schema
The schema of Aggregate, from desflow schema.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |