RainbowStats Command Reference
SOCRATA_DAILY
Aggregate timestamped Socrata observations into a daily series using an explicit rule.
Syntax
SOCRATA_DAILY("DatasetID","APIHeader","Aggregation")
| Aggregation | Meaning |
|---|---|
| SUM | Sum nonmissing values for the day. Appropriate for counts such as hourly bicycle crossings. |
| MEAN | Arithmetic mean of nonmissing rows for the day. Each observed row has equal weight. |
| LAST | Last nonmissing finite value in timestamp order for the day. Conflicting values at the same timestamp produce an error. |
Daily bicycle crossings
North=SOCRATA_DAILY("2z5v-ecg8","bike_north","SUM")
South=SOCRATA_DAILY("2z5v-ecg8","bike_south","SUM")
DailyBikes=SET_NAME(North+South,"Burke-Gilman daily bicycle crossings")
LINE_CHART(DailyBikes)Counts record crossings at the sensor, not distinct cyclists. Pedestrian fields are excluded from this example.
Scope and missing data
A numeric field and one unambiguous usable date/time field are required. Buckets follow the source calendar day. Entirely missing days are omitted; genuine observed zeros are retained. Partial days are aggregated from their observed values, without imputing missing hours. No percentage, currency, or timezone conversion is performed.
Retrieval
SUM and MEAN use Socrata grouping and return up to 100,000 daily groups. LAST reads ordered source rows, with a 2,000,000-row safety limit. Downloads use the existing six-hour cache. The result is a standard RainbowStats series.