Skip to content

Commit

Permalink
minor fixes to TimeseriesQuery and Aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
rasahner committed Jun 24, 2015
1 parent 0a5bb90 commit a938e65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/content/querying/aggregations.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ All JavaScript functions must return numerical values.
```json
{
"type": "javascript",
"name": "sum(log(x)/y) + 10",
"name": "sum(log(x)*y) + 10",
"fieldNames": ["x", "y"],
"fnAggregate" : "function(current, a, b) { return current + (Math.log(a) * b); }",
"fnCombine" : "function(partialA, partialB) { return partialA + partialB; }",
Expand Down Expand Up @@ -137,11 +137,11 @@ SELECT COUNT(DISTINCT(value)) FROM (

#### Cardinality by row

When setting `byRow` to `true` it computes the cardinality by row, i.e. the cardinality of distinct dimension combinations
When setting `byRow` to `true` it computes the cardinality by row, i.e. the cardinality of distinct dimension combinations.
This is equivalent to something akin to

```sql
SELECT COUNT(*) FROM ( SELECT DIM1, DIM2, DIM3 FROM <datasource> GROUP BY DIM1, DIM2, DIM3
SELECT COUNT(*) FROM ( SELECT DIM1, DIM2, DIM3 FROM <datasource> GROUP BY DIM1, DIM2, DIM3 )
```

**Example**
Expand Down
2 changes: 1 addition & 1 deletion docs/content/querying/timeseriesquery.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ There are 7 main parts to a timeseries query:
|postAggregations|See [Post Aggregations](../querying/post-aggregations.html)|no|
|context|See [Context](../querying/query-context.html)|no|

To pull it all together, the above query would return 2 data points, one for each day between 2012-01-01 and 2012-01-03, from the "sample\_datasource" table. Each data point would be the (long) sum of sample\_fieldName1, the (double) sum of sample\_fieldName2 and the (double) the result of sample\_fieldName1 divided by sample\_fieldName2 for the filter set. The output looks like this:
To pull it all together, the above query would return 2 data points, one for each day between 2012-01-01 and 2012-01-03, from the "sample\_datasource" table. Each data point would be the (long) sum of sample\_fieldName1, the (double) sum of sample\_fieldName2 and the (double) result of sample\_fieldName1 divided by sample\_fieldName2 for the filter set. The output looks like this:

```json
[
Expand Down

0 comments on commit a938e65

Please sign in to comment.