Skip to main content
Skip table of contents

Metrics cheatsheet

Sum aggregation

JSON
{
    "name": "query_no_agg_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Count aggregation

JSON
{
    "name": "query_no_agg_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ]
    }
}

Average aggregation

JSON
{
    "name": "query_no_agg_3",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Maximum aggregation

JSON
{
    "name": "query_no_agg_4",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Minimum aggregation

JSON
{
    "name": "query_no_agg_5",
    "type": "metric",
    "content": {
        "type": "function_min",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Standard deviation aggregation

JSON
{
    "name": "query_no_agg_6",
    "type": "metric",
    "content": {
        "type": "function_stddev_samp",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggregate_zsjd_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Count aggregation

JSON
{
    "name": "aggregate_zsjd_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.store_id"
            }
        ]
    }
}

Count_dist aggregation

JSON
{
    "name": "aggregate_zsjd_3",
    "type": "metric",
    "content": {
        "type": "function_count_dist",
        "content": [
            {
                "type": "property",
                "value": "transactions.store_id"
            }
        ]
    }
}

Average aggregation

JSON
{
    "name": "aggregate_zsjd_4",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Maximum aggregation

JSON
{
    "name": "aggregate_zsjd_5",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Minimum aggregation

JSON
{
    "name": "aggregate_zsjd_6",
    "type": "metric",
    "content": {
        "type": "function_min",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Standard deviation aggregation

JSON
{
    "name": "aggregate_zsjd_7",
    "type": "metric",
    "content": {
        "type": "function_stddev_samp",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with aggregateBy to null

JSON
{
    "name": "aggr_by_null_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Count with aggregateBy to null

JSON
{
    "name": "aggr_by_null_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Count with aggregateBy to null

JSON
{
    "name": "aggr_by_null_3",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.store_id"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Division ofs with aggregateBy to null

JSON
{
    "name": "aggr_by_null_filter_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.customer_id"
                    }
                ]
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.customer_id"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        null
                    ]
                }
            }
        ]
    }
}

Sum with aggregateBy to null

JSON
{
    "name": "aggr_by_null_no_granul_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Count with aggregateBy to null

JSON
{
    "name": "aggr_by_null_no_granul_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Count with aggregateBy to null

JSON
{
    "name": "aggr_by_null_no_granul_3",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.store_id"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Division of aggregations

JSON
{
    "name": "arithm_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Subtraction of aggregations

JSON
{
    "name": "arithm_2",
    "type": "metric",
    "content": {
        "type": "function_minus",
        "content": [
            {
                "type": "number",
                "value": 625.45
            },
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 1.21
                    }
                ]
            }
        ]
    }
}

Multiplication of aggregations

JSON
{
    "name": "arithm_3",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1.21
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.store_id"
                    }
                ]
            }
        ]
    }
}

Division of aggregations

JSON
{
    "name": "variable_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "variable",
                "value": "number_1000"
            }
        ]
    }
}

Subtraction of aggregations

JSON
{
    "name": "variable_2",
    "type": "metric",
    "content": {
        "type": "function_minus",
        "content": [
            {
                "type": "variable",
                "value": "number_625"
            },
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "variable",
                        "value": "number_121"
                    }
                ]
            }
        ]
    }
}

Multiplication of aggregations

JSON
{
    "name": "variable_3",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "variable",
                "value": "number_121"
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.store_id"
                    }
                ]
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "round_1",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "function_avg",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Rounding aggregation

JSON
{
    "name": "round_2",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "function_avg",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "places": -2
        }
    }
}

Average aggregation

JSON
{
    "name": "round_3",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "function_round",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "places": 1
                }
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "round_4",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 1000.0
                    }
                ]
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Division of aggregations

JSON
{
    "name": "round_5",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_round",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    }
                ],
                "options": {
                    "places": 1
                }
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "round_property_1",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    },
                    {
                        "type": "number",
                        "value": 1000.0
                    }
                ]
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Sum aggregation

JSON
{
    "name": "round_property_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "round_property_count_1",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "property",
                "value": "customers.lat"
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Rounding aggregation

JSON
{
    "name": "round_property_count_2",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Sum aggregation

JSON
{
    "name": "round_property_count_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Count aggregation

JSON
{
    "name": "round_property_count_4",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "customers.identifier"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_in_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_extern_property_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ]
    }
}

Division ofs with aggregateBy to null with withoutFilters

JSON
{
    "name": "having_just_one_zsjd_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        null
                    ],
                    "withoutFilters": [
                        "transactions.store_id"
                    ]
                }
            }
        ]
    }
}

Division of aggregations

JSON
{
    "name": "having_percent_turnover_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Sum with equality filter

JSON
{
    "name": "having_percent_turnover_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Division ofs with aggregateBy to null

JSON
{
    "name": "having_percent_turnover_3",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        null
                    ]
                }
            }
        ]
    }
}

Sum with multiple filters with equality filter

JSON
{
    "name": "local_filter_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 35.2,
                    "operator": "gt"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "local_filter_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "without_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with equality filter

JSON
{
    "name": "without_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Sum with equality filter

JSON
{
    "name": "without_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "trans*.*_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "without_all_filters_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with multiple filters with equality filter

JSON
{
    "name": "without_all_filters_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 35.2,
                    "operator": "gt"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "without_from_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with equality filter

JSON
{
    "name": "without_from_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "from:transactions"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Sum with equality filter

JSON
{
    "name": "without_from_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "from:customers"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Ntile buckets with ntile buckets

JSON
{
    "name": "ntile_1",
    "type": "metric",
    "content": {
        "type": "function_ntile",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc",
            "buckets": 3
        }
    }
}

Sum aggregation

JSON
{
    "name": "ntile_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Ntile buckets with ntile buckets

JSON
{
    "name": "ntile_filter_by_1",
    "type": "metric",
    "content": {
        "type": "function_ntile",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc",
            "buckets": 3
        }
    }
}

Sum aggregation

JSON
{
    "name": "ntile_filter_by_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Ntile buckets with partitionBy with ntile buckets

JSON
{
    "name": "ntile_partition_by_1",
    "type": "metric",
    "content": {
        "type": "function_ntile",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc",
            "buckets": 8,
            "partitionBy": [
                "kod_zsj_d"
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "ntile_partition_by_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Rank aggregation

JSON
{
    "name": "rank_1",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Sum aggregation

JSON
{
    "name": "rank_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Rank with partitionBy

JSON
{
    "name": "rank_partition_by_1",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "partitionBy": [
                "kod_zsj_d"
            ],
            "sort": "desc"
        }
    }
}

Sum aggregation

JSON
{
    "name": "rank_partition_by_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Rank with withoutFilters

JSON
{
    "name": "rank_with_filter_1",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "withoutFilters": [
                        "*.*"
                    ]
                }
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Sum with in filter

JSON
{
    "name": "rank_with_filter_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "*.*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": [
                        100,
                        101
                    ],
                    "operator": "in"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "rank_with_filter_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Division of aggregations

JSON
{
    "name": "can_2694_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Sum with equality filter

JSON
{
    "name": "can_2694_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Division ofs with aggregateBy to null with withoutFilters

JSON
{
    "name": "can_2694_3",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        null
                    ],
                    "withoutFilters": [
                        "zsj_desc.kod_zsj_d"
                    ]
                }
            }
        ]
    }
}

Sum with equality filter

JSON
{
    "name": "can_2751_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "can_2751_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ]
    }
}

Sum with greater than filter

JSON
{
    "name": "can_3062_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.value",
                    "value": 100,
                    "operator": "gt"
                }
            ]
        }
    }
}

Sum with greater than filter

JSON
{
    "name": "can_3062_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.value",
                    "value": 75,
                    "operator": "gt"
                }
            ]
        }
    }
}

Sum with greater than filter

JSON
{
    "name": "can_3062_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gt"
                }
            ]
        }
    }
}

Sum with multiple filters with lte filter

JSON
{
    "name": "filter_property_in_limit_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "zsj_desc.*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": [
                        100
                    ],
                    "operator": "in"
                },
                {
                    "property": "transactions.store_id",
                    "value": [
                        100,
                        102
                    ],
                    "operator": "in"
                },
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "value": 22222,
                    "operator": "lte"
                }
            ]
        }
    }
}

Sum with multiple filters with lte filter

JSON
{
    "name": "filter_property_in_limit_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": [
                        100,
                        102
                    ],
                    "operator": "in"
                },
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "value": 22222,
                    "operator": "lte"
                }
            ]
        }
    }
}

Rank aggregation

JSON
{
    "name": "rank_of_arithm_1",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "function_count",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.identifier"
                            }
                        ]
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Division of aggregations

JSON
{
    "name": "rank_of_arithm_2",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.identifier"
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ]
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_4",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "transaction_sum",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "transaction_sum",
                                "value": 70,
                                "operator": "gt"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_5",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "transaction_sum",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "withoutFilters": [
                                        "transactions.store_id"
                                    ]
                                }
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "transaction_sum",
                                "value": 70,
                                "operator": "gt"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_variable_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "transaction_sum",
                                "type": "function_multiply",
                                "content": [
                                    {
                                        "type": "function_sum",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ]
                                    },
                                    {
                                        "type": "variable",
                                        "value": "number_100"
                                    }
                                ]
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "transaction_sum",
                                "value": 700,
                                "operator": "gt"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_global_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                },
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "transaction_sum",
                                "type": "function_multiply",
                                "content": [
                                    {
                                        "type": "function_sum",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ]
                                    },
                                    {
                                        "type": "variable",
                                        "value": "number_100"
                                    }
                                ]
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "transaction_sum",
                                "value": 700,
                                "operator": "gt"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_attribute_combined_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.value",
                                "value": 45,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.value",
                    "value": 25,
                    "operator": "gte"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Multiplication ofs with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_attribute_nested_1",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "withoutFilters": [
                        "transactions.store_id"
                    ],
                    "filterBy": [
                        {
                            "property": "zsj_desc.kod_zsj_d",
                            "query": {
                                "properties": [
                                    {
                                        "id": "kod_zsj_d",
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    }
                                ]
                            },
                            "operator": "inAttribute"
                        },
                        {
                            "property": "transactions.value",
                            "value": 50,
                            "operator": "gte"
                        }
                    ]
                }
            },
            {
                "id": "nested_in_attribute",
                "type": "number",
                "value": 13.0
            }
        ]
    }
}

Addition ofs with equality filter

JSON
{
    "name": "ifnull_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 101,
                                    "operator": "eq"
                                }
                            ]
                        }
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "eq"
                        }
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_nor_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_or_and_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_without_filters_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with withoutFilters

JSON
{
    "name": "filter_by_boolean_without_filters_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "trans*.va*"
            ],
            "filterBy": [
                {
                    "operator": "or",
                    "content": [
                        {
                            "property": "transactions.value",
                            "value": 20,
                            "operator": "lte"
                        },
                        {
                            "property": "transactions.value",
                            "value": 80,
                            "operator": "gte"
                        }
                    ]
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_without_filters_2_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with multiple filters

JSON
{
    "name": "filter_by_boolean_without_filters_2_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "trans*.va*"
            ],
            "filterBy": [
                {
                    "operator": "or",
                    "content": [
                        {
                            "property": "transactions.value",
                            "value": 20,
                            "operator": "lte"
                        },
                        {
                            "property": "transactions.processed_at",
                            "value": "2015-10-21",
                            "operator": "gte"
                        }
                    ]
                },
                {
                    "operator": "or",
                    "content": [
                        {
                            "property": "transactions.identifier",
                            "value": 1,
                            "operator": "gte"
                        },
                        {
                            "property": "transactions.processed_at",
                            "value": "2015-10-21",
                            "operator": "gte"
                        }
                    ]
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_without_filters_3_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with withoutFilters

JSON
{
    "name": "filter_by_boolean_without_filters_3_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "customers.*"
            ],
            "filterBy": [
                {
                    "operator": "or",
                    "content": [
                        {
                            "value": "8d195c0238e44bf",
                            "function": {
                                "type": "function_h3_grid",
                                "options": {
                                    "dataset": "customers",
                                    "resolution": 13
                                },
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "customers.lng"
                                    },
                                    {
                                        "type": "property",
                                        "value": "customers.lat"
                                    }
                                ]
                            },
                            "operator": "eq"
                        },
                        {
                            "property": "transactions.processed_at",
                            "value": "2015-10-21",
                            "operator": "gte"
                        }
                    ]
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "having_boolean_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "having_boolean_two_metrics_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Count aggregation

JSON
{
    "name": "having_boolean_two_metrics_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ]
    }
}

Sum with withoutFilters

JSON
{
    "name": "filter_by_boolean_and_attribute_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "operator": "and",
                    "content": [
                        {
                            "property": "zsj_desc.kod_zsj_d",
                            "query": {
                                "properties": [
                                    {
                                        "id": "kod_zsj_d",
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    },
                                    {
                                        "id": "transaction_sum",
                                        "type": "function_sum",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ]
                                    }
                                ],
                                "having": [
                                    {
                                        "propertyId": "transaction_sum",
                                        "value": 120,
                                        "operator": "lte"
                                    }
                                ]
                            },
                            "operator": "inAttribute"
                        },
                        {
                            "property": "zsj_desc.kod_zsj_d",
                            "query": {
                                "properties": [
                                    {
                                        "id": "kod_zsj_d",
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    },
                                    {
                                        "id": "transaction_sum",
                                        "type": "function_sum",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ]
                                    }
                                ],
                                "having": [
                                    {
                                        "propertyId": "transaction_sum",
                                        "value": 95,
                                        "operator": "gte"
                                    }
                                ]
                            },
                            "operator": "inAttribute"
                        }
                    ]
                }
            ]
        }
    }
}

Sum with withoutFilters

JSON
{
    "name": "filter_by_boolean_or_attribute_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "operator": "or",
                    "content": [
                        {
                            "property": "zsj_desc.kod_zsj_d",
                            "query": {
                                "properties": [
                                    {
                                        "id": "kod_zsj_d",
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    },
                                    {
                                        "id": "transaction_sum",
                                        "type": "function_sum",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ]
                                    }
                                ],
                                "having": [
                                    {
                                        "propertyId": "transaction_sum",
                                        "value": 72,
                                        "operator": "lte"
                                    }
                                ]
                            },
                            "operator": "inAttribute"
                        },
                        {
                            "property": "zsj_desc.kod_zsj_d",
                            "query": {
                                "properties": [
                                    {
                                        "id": "kod_zsj_d",
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    },
                                    {
                                        "id": "transaction_sum",
                                        "type": "function_sum",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ]
                                    }
                                ],
                                "having": [
                                    {
                                        "propertyId": "transaction_sum",
                                        "value": 160,
                                        "operator": "gte"
                                    }
                                ]
                            },
                            "operator": "inAttribute"
                        }
                    ]
                }
            ]
        }
    }
}

Percentile aggregation

JSON
{
    "name": "percentile_1",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Sum aggregation

JSON
{
    "name": "percentile_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Percentile aggregation

JSON
{
    "name": "percentile_arithm_1",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_divide",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            },
                            {
                                "type": "function_count",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.customer_id"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Division of aggregations

JSON
{
    "name": "percentile_arithm_2",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.customer_id"
                    }
                ]
            }
        ],
        "options": {}
    }
}

Percentile with partitionBy

JSON
{
    "name": "percentile_partition_by_1",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "partitionBy": [
                "kod_zsj_d"
            ],
            "sort": "desc"
        }
    }
}

Sum aggregation

JSON
{
    "name": "percentile_partition_by_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Percentile aggregation

JSON
{
    "name": "percentile_same_values_1",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.customer_id"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Count aggregation

JSON
{
    "name": "percentile_same_values_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.customer_id"
            }
        ]
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_filters_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "transactions.*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_filters_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_filters_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "customers.*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_filters_from_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "from:zsj_desc"
            ],
            "filterBy": [
                {
                    "property": "customers.identifier",
                    "value": 2000,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_filters_from_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "from:customers"
            ],
            "filterBy": [
                {
                    "property": "customers.identifier",
                    "value": 2000,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_filters_from_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "from:transactions"
            ],
            "filterBy": [
                {
                    "property": "customers.identifier",
                    "value": 2000,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_without_filters_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "transactions.*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_without_filters_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum with multiple filters with gte filter

JSON
{
    "name": "accept_without_filters_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "customers.*",
                "transactions.store*"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 100,
                    "operator": "eq"
                },
                {
                    "property": "transactions.value",
                    "value": 50,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "big_numbers_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    },
                    {
                        "type": "number",
                        "value": 1.0E9
                    }
                ]
            }
        ]
    }
}

Multiplication of aggregations

JSON
{
    "name": "big_numbers_2",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 4.56789123435E9
            }
        ]
    }
}

Multiplication of aggregations

JSON
{
    "name": "big_numbers_3",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 6.789123435E7
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_date_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with multiple filters with equality filter

JSON
{
    "name": "filter_by_not_in_attribute_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ]
                    },
                    "operator": "notInAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "eq"
                }
            ]
        }
    }
}

Count aggregation

JSON
{
    "name": "having_filter_count_by_decimal_1",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_function_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_function_today_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_function_date_trunc_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_function_interval_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with acceptAggregateBy

JSON
{
    "name": "accept_aggr_by_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptAggregateBy": [
                "zsj_desc"
            ]
        }
    }
}

Count with acceptAggregateBy

JSON
{
    "name": "accept_aggr_by_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ],
        "options": {
            "acceptAggregateBy": [
                "zsj*"
            ]
        }
    }
}

Count with dontAggregateBy

JSON
{
    "name": "accept_aggr_by_3",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.store_id"
            }
        ],
        "options": {
            "dontAggregateBy": [
                "customers"
            ]
        }
    }
}

Sum with acceptAggregateBy

JSON
{
    "name": "accept_aggr_by_null_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "acceptAggregateBy": [
                "zsj_desc",
                null
            ]
        }
    }
}

Count with acceptAggregateBy

JSON
{
    "name": "accept_aggr_by_null_2",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ],
        "options": {
            "acceptAggregateBy": [
                null
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_two_filters_nested_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_two_filters_nested_filters_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with inAttribute filter

JSON
{
    "name": "filter_by_attribute_two_filters_nested_to_metric_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "population_where_store_id_ne_101",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "zsj_desc.population"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "zsj_desc.kod_zsj_d",
                                            "query": {
                                                "properties": [
                                                    {
                                                        "id": "kod_zsj_d",
                                                        "type": "property",
                                                        "value": "zsj_desc.kod_zsj_d"
                                                    },
                                                    {
                                                        "id": "aux_metric",
                                                        "type": "function_count",
                                                        "content": [
                                                            {
                                                                "type": "property",
                                                                "value": "zsj_desc.kod_zsj_d"
                                                            }
                                                        ],
                                                        "options": {
                                                            "withoutFilters": [
                                                                "*.*"
                                                            ],
                                                            "filterBy": [
                                                                {
                                                                    "property": "transactions.store_id",
                                                                    "value": 101,
                                                                    "operator": "eq"
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ]
                                            },
                                            "operator": "inAttribute"
                                        }
                                    ]
                                }
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "population_where_store_id_ne_101",
                                "value": 500,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Sum with inAttribute filter

JSON
{
    "name": "filter_by_attribute_two_filters_one_skippable_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "population_where_store_id_ne_101",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "zsj_desc.population"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "zsj_desc.kod_zsj_d",
                                            "query": {
                                                "properties": [
                                                    {
                                                        "id": "kod_zsj_d",
                                                        "type": "property",
                                                        "value": "zsj_desc.kod_zsj_d"
                                                    },
                                                    {
                                                        "id": "aux_metric",
                                                        "type": "function_count",
                                                        "content": [
                                                            {
                                                                "type": "property",
                                                                "value": "zsj_desc.kod_zsj_d"
                                                            }
                                                        ],
                                                        "options": {
                                                            "withoutFilters": [
                                                                "*.*"
                                                            ]
                                                        }
                                                    }
                                                ]
                                            },
                                            "operator": "inAttribute"
                                        }
                                    ]
                                }
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "population_where_store_id_ne_101",
                                "value": 500,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_two_filters_flat_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "population_where_store_id_ne_101",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "zsj_desc.population"
                                    }
                                ],
                                "options": {
                                    "withoutFilters": [
                                        "zsjd_desc.*"
                                    ]
                                }
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "population_where_store_id_ne_101",
                                "value": 500,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "aux_metric",
                                "type": "function_count",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    }
                                ],
                                "options": {
                                    "withoutFilters": [
                                        "zsjd_desc.*"
                                    ]
                                }
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.store_id",
                                "value": 101,
                                "operator": "eq"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Sum with inAttribute filter

JSON
{
    "name": "skip_in_attribute_filter_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Row number with partitionBy

JSON
{
    "name": "row_number_zsjd_store_by_revenue_1",
    "type": "metric",
    "content": {
        "type": "function_row_number",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ],
        "options": {
            "partitionBy": [
                "kod_zsj_d"
            ],
            "sort": "desc"
        }
    }
}

Row number with partitionBy with gte filter

JSON
{
    "name": "row_number_zsjd_store_avg_transaction_1",
    "type": "metric",
    "content": {
        "type": "function_row_number",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.value",
                                    "value": 0,
                                    "operator": "gte"
                                }
                            ]
                        }
                    },
                    {
                        "type": "function_count",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.identifier"
                            }
                        ]
                    }
                ]
            }
        ],
        "options": {
            "partitionBy": [
                "kod_zsj_d"
            ],
            "sort": "desc"
        }
    }
}

Row number aggregation

JSON
{
    "name": "row_number_store_by_transaction_count_1",
    "type": "metric",
    "content": {
        "type": "function_row_number",
        "content": [
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.identifier"
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Multiplication of aggregations

JSON
{
    "name": "can_7610_1",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.identifier"
                    }
                ]
            },
            {
                "type": "number",
                "value": 13.467
            }
        ]
    }
}

Addition of aggregations

JSON
{
    "name": "can_7610_2",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "number",
                "value": 13.467
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.identifier"
                    }
                ]
            }
        ]
    }
}

Sum with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_attribute_combined_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.value",
                                "value": 45,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.value",
                    "value": 25,
                    "operator": "gte"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_attribute_combined_cache_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.value",
                                "value": 45,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.value",
                    "value": 25,
                    "operator": "gte"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Maximum aggregation

JSON
{
    "name": "filter_pushdown_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "property",
                "value": "customers.identifier"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_pushdown_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_pushdown_2_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "customers.identifier"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_pushdown_2_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_by_customer_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "aggregateBy": [
                "transactions.customer_id"
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "aggr_by_customer_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "aggregateBy": [
                "transactions.store_id"
            ]
        }
    }
}

Sum with aggregateBy to null

JSON
{
    "name": "aggr_by_customer_3",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_by_store_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id"
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_by_store_customer_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id",
                        "transactions.customer_id"
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_by_store_filter_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id",
                        "transactions.customer_id"
                    ],
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "ne"
                        }
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_by_store_of_max_by_customer_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id"
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_by_zsjd_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "zsj_desc.kod_zsj_d"
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_number_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "number",
                        "value": 1000.0
                    },
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_min_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_min_glob_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_min_glob_by_cust_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_by_customer_of_max_multiply_min_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Addition of aggregations

JSON
{
    "name": "aggr_sum_of_max_plus_min_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    }
                ]
            },
            {
                "type": "function_min",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ]
    }
}

Addition of aggregations

JSON
{
    "name": "aggr_sum_by_zsjd_of_max_plus_min_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    }
                ]
            },
            {
                "type": "function_min",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ]
    }
}

Sum with withoutFilters

JSON
{
    "name": "aggr_sum_of_max_without_nested_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id"
                    ],
                    "withoutFilters": [
                        "transactions.*"
                    ]
                }
            }
        ]
    }
}

Sum with acceptAggregateBy

JSON
{
    "name": "aggr_sum_of_max_accept_aggr_by_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id"
                    ],
                    "acceptAggregateBy": [
                        "transactions"
                    ]
                }
            }
        ]
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_sum_of_max_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "zsj_desc.population"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            },
                            {
                                "id": "transaction_sum_max_customer",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "function_max",
                                        "content": [
                                            {
                                                "type": "property",
                                                "value": "transactions.value"
                                            }
                                        ],
                                        "options": {
                                            "aggregateBy": [
                                                "transactions.customer_id"
                                            ]
                                        }
                                    }
                                ]
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "transaction_sum_max_customer",
                                "value": 65,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "ne"
                }
            ]
        }
    }
}

Division of aggregations

JSON
{
    "name": "aggr_max_by_zsjd_of_sum_by_store_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_max",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "zsj_desc.population"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_count_by_store_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.identifier"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id"
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_count_dist_by_store_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "zsj_desc.kod_zsj_d"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.customer_id"
                    ]
                }
            }
        ]
    }
}

Count aggregation

JSON
{
    "name": "aggr_count_by_customer_1",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.identifier"
            }
        ],
        "options": {
            "aggregateBy": [
                "transactions.customer_id"
            ]
        }
    }
}

Count aggregation

JSON
{
    "name": "aggr_count_dist_by_customer_1",
    "type": "metric",
    "content": {
        "type": "function_count",
        "content": [
            {
                "type": "property",
                "value": "transactions.processed_at"
            }
        ],
        "options": {
            "aggregateBy": [
                "transactions.customer_id"
            ]
        }
    }
}

Division ofs with aggregateBy to null

JSON
{
    "name": "can_8477_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        null
                    ]
                }
            }
        ]
    }
}

Maximum with acceptAggregateBy

JSON
{
    "name": "aggr_max_sum_accept_aggregate_by_store_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ],
                            "acceptAggregateBy": [
                                "transactions"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Maximum with dontAggregateBy

JSON
{
    "name": "aggr_max_sum_dont_aggregate_by_store_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ],
                            "dontAggregateBy": [
                                "zsj_*"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Maximum with acceptAggregateBy

JSON
{
    "name": "aggr_max_sum_accept_aggregate_all_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ],
                            "acceptAggregateBy": [
                                "*"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Maximum with equality filter

JSON
{
    "name": "aggr_max_by_store_by_client_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ]
                        }
                    },
                    {
                        "type": "function_count",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.identifier"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ],
                            "filterBy": [
                                {
                                    "property": "transactions.customer_id",
                                    "value": 2002,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Maximum with acceptAggregateBy

JSON
{
    "name": "aggr_max_sum_accept_aggregate_by_store_one_agg_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.store_id"
                    ],
                    "acceptAggregateBy": [
                        "transactions"
                    ]
                }
            }
        ]
    }
}

Maximum with acceptAggregateBy with equality filter

JSON
{
    "name": "aggr_max_sum_accept_aggregate_by_store_two_agg_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ],
                            "filterBy": [
                                {
                                    "property": "zsj_desc.kod_zsj_d",
                                    "value": 11111,
                                    "operator": "eq"
                                }
                            ],
                            "acceptAggregateBy": [
                                "transactions"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.store_id"
                            ],
                            "filterBy": [
                                {
                                    "property": "zsj_desc.kod_zsj_d",
                                    "value": 33333,
                                    "operator": "ne"
                                }
                            ],
                            "acceptAggregateBy": [
                                "transactions"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Maximum aggregation

JSON
{
    "name": "can_8366_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "property",
                "value": "customers.identifier"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "can_8366_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "one_metric_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "one_metric_two_attrs_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "one_metric_two_primary_keys_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_metric_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.processed_at"
            ],
            "filterBy": [
                {
                    "property": "transactions.processed_at",
                    "query": {
                        "properties": [
                            {
                                "id": "max_date",
                                "type": "function_max",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.processed_at"
                                    }
                                ]
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.processed_at",
                    "value": "2015-11-01",
                    "operator": "gte"
                },
                {
                    "property": "transactions.processed_at",
                    "value": "2015-11-07",
                    "operator": "lt"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_metric_inherit_granularities_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.processed_at"
            ],
            "filterBy": [
                {
                    "property": "transactions.processed_at",
                    "query": {
                        "properties": [
                            {
                                "id": "max_date",
                                "type": "function_max",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.processed_at"
                                    }
                                ],
                                "options": {
                                    "acceptAggregateBy": [
                                        "transactions"
                                    ]
                                }
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.processed_at",
                    "value": "2015-11-01",
                    "operator": "gte"
                },
                {
                    "property": "transactions.processed_at",
                    "value": "2015-11-07",
                    "operator": "lt"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters with gte filter

JSON
{
    "name": "filter_by_metric_inherit_granularities_dont_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.processed_at"
            ],
            "filterBy": [
                {
                    "property": "transactions.processed_at",
                    "query": {
                        "properties": [
                            {
                                "id": "max_date",
                                "type": "function_max",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.processed_at"
                                    }
                                ],
                                "options": {
                                    "dontAggregateBy": [
                                        "customers"
                                    ]
                                }
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.processed_at",
                    "value": "2015-11-01",
                    "operator": "gte"
                },
                {
                    "property": "transactions.processed_at",
                    "value": "2015-11-07",
                    "operator": "lt"
                }
            ]
        }
    }
}

H3_grid aggregation

JSON
{
    "name": "h3_grid_1",
    "type": "metric",
    "content": {
        "type": "function_h3_grid",
        "options": {
            "dataset": "customers",
            "resolution": 13
        },
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            },
            {
                "type": "property",
                "value": "customers.lat"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "h3_grid_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

H3_grid aggregation

JSON
{
    "name": "h3_grid_resultset_1",
    "type": "metric",
    "content": {
        "type": "function_h3_grid",
        "options": {
            "dataset": "customers",
            "resolution": 13
        },
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            },
            {
                "type": "property",
                "value": "customers.lat"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "h3_grid_resultset_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_function_h3_grid_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_function_h3_grid_eq_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_h3_grid_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

H3_grid aggregation

JSON
{
    "name": "filter_by_attribute_h3_grid_two_resolutions_1",
    "type": "metric",
    "content": {
        "type": "function_h3_grid",
        "options": {
            "dataset": "customers",
            "resolution": 13
        },
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            },
            {
                "type": "property",
                "value": "customers.lat"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_h3_grid_two_resolutions_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with inAttribute filter with multiple filters with equality filter

JSON
{
    "name": "filter_by_attribute_order_1_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "eq"
                },
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.value",
                                "value": 15,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_order_2_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_attribute_order_inject_inAttribute_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum with inAttribute filter with multiple filters

JSON
{
    "name": "filter_by_attribute_order_nested_inAttributes_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "transactions.store_id",
                    "query": {
                        "properties": [
                            {
                                "id": "store_id",
                                "type": "property",
                                "value": "transactions.store_id"
                            },
                            {
                                "id": "store_value",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "store_value",
                                "value": 111,
                                "operator": "lte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "customers.identifier",
                    "query": {
                        "properties": [
                            {
                                "id": "customer",
                                "type": "property",
                                "value": "customers.identifier"
                            },
                            {
                                "id": "customer_value",
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            }
                        ],
                        "having": [
                            {
                                "propertyId": "customer_value",
                                "value": 71.1,
                                "operator": "gt"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Sum with inAttribute filter with multiple filters with equality filter

JSON
{
    "name": "filter_by_attribute_order_two_inAttributes_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "withoutFilters": [
                "transactions.store_id"
            ],
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.value",
                                "value": 42.7,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                },
                {
                    "property": "transactions.store_id",
                    "value": 101,
                    "operator": "eq"
                },
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "kod_zsj_d",
                                "type": "property",
                                "value": "zsj_desc.kod_zsj_d"
                            }
                        ],
                        "filterBy": [
                            {
                                "property": "transactions.value",
                                "value": 15,
                                "operator": "gte"
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Percent_to_total aggregation

JSON
{
    "name": "percent_of_total_1",
    "type": "metric",
    "content": {
        "type": "function_percent_to_total",
        "content": [
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.customer_id"
                    }
                ]
            }
        ]
    }
}

Percent_to_total aggregation

JSON
{
    "name": "percent_of_total_nested_aggr_1",
    "type": "metric",
    "content": {
        "type": "function_percent_to_total",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_count",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.customer_id"
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Sum with inAttribute filter

JSON
{
    "name": "can_12816_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "property": "zsj_desc.kod_zsj_d",
                    "query": {
                        "properties": [
                            {
                                "id": "max_kod_zsj_d",
                                "type": "function_max",
                                "content": [
                                    {
                                        "id": "max_kod_zsj_d",
                                        "type": "property",
                                        "value": "zsj_desc.kod_zsj_d"
                                    }
                                ]
                            }
                        ]
                    },
                    "operator": "inAttribute"
                }
            ]
        }
    }
}

Division of aggregations

JSON
{
    "name": "can_14843_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "id": "metric_turnover",
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Division of aggregations

JSON
{
    "name": "can_14843_2",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "id": "metric_turnover",
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000000.0
            }
        ]
    }
}

Maximum with acceptAggregateBy

JSON
{
    "name": "can_14900_1",
    "type": "metric",
    "content": {
        "type": "function_max",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "transactions.identifier"
                    ],
                    "acceptAggregateBy": [
                        "transactions"
                    ]
                }
            }
        ]
    }
}

Distance calculation aggregation

JSON
{
    "name": "distance_1",
    "type": "metric",
    "content": {
        "type": "function_distance",
        "options": {
            "dataset": "customers",
            "centralPoint": {
                "lat": 52.4805067,
                "lng": -1.8939561
            }
        },
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            },
            {
                "type": "property",
                "value": "customers.lat"
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "distance_2",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "id": "computed_distance",
                "type": "function_distance",
                "options": {
                    "dataset": "customers",
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                },
                "content": [
                    {
                        "type": "property",
                        "value": "customers.lng"
                    },
                    {
                        "type": "property",
                        "value": "customers.lat"
                    }
                ]
            }
        ],
        "options": {
            "places": 0
        }
    }
}

Average with aggregateBy to null

JSON
{
    "name": "distance_3",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "function_distance",
                "options": {
                    "dataset": "customers",
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                },
                "content": [
                    {
                        "type": "property",
                        "value": "customers.lng"
                    },
                    {
                        "type": "property",
                        "value": "customers.lat"
                    }
                ]
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ]
        }
    }
}

Average aggregation

JSON
{
    "name": "distance_avg_1",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "function_distance",
                "options": {
                    "dataset": "customers",
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                },
                "content": [
                    {
                        "type": "property",
                        "value": "customers.lng"
                    },
                    {
                        "type": "property",
                        "value": "customers.lat"
                    }
                ]
            }
        ]
    }
}

Average aggregation

JSON
{
    "name": "distance_avg_in_attribute_1",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "function_distance",
                "options": {
                    "dataset": "customers",
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                },
                "content": [
                    {
                        "type": "property",
                        "value": "customers.lng"
                    },
                    {
                        "type": "property",
                        "value": "customers.lat"
                    }
                ]
            }
        ]
    }
}

Distance calculation aggregation

JSON
{
    "name": "distance_per_trans_1",
    "type": "metric",
    "content": {
        "type": "function_distance",
        "options": {
            "dataset": "customers",
            "centralPoint": {
                "lat": 52.4805067,
                "lng": -1.8939561
            }
        },
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            },
            {
                "type": "property",
                "value": "customers.lat"
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "distance_per_trans_2",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "id": "computed_distance",
                "type": "function_distance",
                "options": {
                    "dataset": "customers",
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                },
                "content": [
                    {
                        "type": "property",
                        "value": "customers.lng"
                    },
                    {
                        "type": "property",
                        "value": "customers.lat"
                    }
                ]
            }
        ],
        "options": {
            "places": 0
        }
    }
}

Average with aggregateBy to null with gte filter

JSON
{
    "name": "distance_per_trans_3",
    "type": "metric",
    "content": {
        "type": "function_avg",
        "content": [
            {
                "type": "function_distance",
                "options": {
                    "dataset": "customers",
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                },
                "content": [
                    {
                        "type": "property",
                        "value": "customers.lng"
                    },
                    {
                        "type": "property",
                        "value": "customers.lat"
                    }
                ]
            }
        ],
        "options": {
            "aggregateBy": [
                null
            ],
            "filterBy": [
                {
                    "property": "transactions.value",
                    "value": 25,
                    "operator": "gte"
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_nearest_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Division of aggregations

JSON
{
    "name": "filter_by_nearest_2",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_nearest_limit_2_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "operator": "nearest",
                    "dataset": "customers",
                    "limit": 1,
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_nearest_limit_2_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "customers.identifier"
                    ],
                    "filterBy": [
                        {
                            "operator": "nearest",
                            "dataset": "customers",
                            "limit": 2,
                            "centralPoint": {
                                "lat": 52.4805067,
                                "lng": -1.8939561
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_nearest_limit_2_no_props_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ],
        "options": {
            "filterBy": [
                {
                    "operator": "nearest",
                    "dataset": "customers",
                    "limit": 1,
                    "centralPoint": {
                        "lat": 52.4805067,
                        "lng": -1.8939561
                    }
                }
            ]
        }
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_nearest_limit_2_no_props_2",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "aggregateBy": [
                        "customers.identifier"
                    ],
                    "filterBy": [
                        {
                            "operator": "nearest",
                            "dataset": "customers",
                            "limit": 2,
                            "centralPoint": {
                                "lat": 52.4805067,
                                "lng": -1.8939561
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_nearest_second_filter_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Division of aggregations

JSON
{
    "name": "filter_by_nearest_second_filter_2",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Exp aggregation

JSON
{
    "name": "exp_1",
    "type": "metric",
    "content": {
        "type": "function_exp",
        "content": [
            {
                "type": "function_ln",
                "content": [
                    {
                        "type": "function_avg",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Exp aggregation

JSON
{
    "name": "exp_2",
    "type": "metric",
    "content": {
        "type": "function_exp",
        "content": [
            {
                "type": "function_ln",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Exp aggregation

JSON
{
    "name": "exp_3",
    "type": "metric",
    "content": {
        "type": "function_exp",
        "content": [
            {
                "type": "function_ln",
                "content": [
                    {
                        "type": "function_divide",
                        "content": [
                            {
                                "type": "function_avg",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            },
                            {
                                "type": "number",
                                "value": 10.0
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Ln aggregation

JSON
{
    "name": "ln_1",
    "type": "metric",
    "content": {
        "type": "function_ln",
        "content": [
            {
                "type": "function_avg",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ]
    }
}

Ln aggregation

JSON
{
    "name": "ln_2",
    "type": "metric",
    "content": {
        "type": "function_ln",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ]
    }
}

Ln aggregation

JSON
{
    "name": "ln_3",
    "type": "metric",
    "content": {
        "type": "function_ln",
        "content": [
            {
                "type": "function_divide",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 1000.0
                    }
                ]
            }
        ]
    }
}

Greatest aggregation

JSON
{
    "name": "greatest_1",
    "type": "metric",
    "content": {
        "type": "function_greatest",
        "content": [
            {
                "type": "number",
                "value": 10.4
            },
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 1.21
                    }
                ]
            },
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_count",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 0.5
                    }
                ]
            }
        ]
    }
}

Greatest aggregation

JSON
{
    "name": "greatest_2",
    "type": "metric",
    "content": {
        "type": "function_greatest",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 852.0
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.store_id"
                    }
                ]
            }
        ]
    }
}

Greatest aggregation

JSON
{
    "name": "greatest_3",
    "type": "metric",
    "content": {
        "type": "function_greatest",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ]
    }
}

Least aggregation

JSON
{
    "name": "least_1",
    "type": "metric",
    "content": {
        "type": "function_least",
        "content": [
            {
                "type": "number",
                "value": 10.4
            },
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 1.21
                    }
                ]
            },
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_count",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "number",
                        "value": 0.5
                    }
                ]
            }
        ]
    }
}

Least aggregation

JSON
{
    "name": "least_2",
    "type": "metric",
    "content": {
        "type": "function_least",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            },
            {
                "type": "number",
                "value": 1.21
            },
            {
                "type": "function_count",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.store_id"
                    }
                ]
            }
        ]
    }
}

Least aggregation

JSON
{
    "name": "least_3",
    "type": "metric",
    "content": {
        "type": "function_least",
        "content": [
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_different_gran1_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_avg",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.customer_id"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.customer_id"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_different_gran2_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_stddev_samp",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d",
                                "transactions.customer_id"
                            ]
                        }
                    },
                    {
                        "type": "function_avg",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "transactions.customer_id"
                            ]
                        }
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "aggr_sum_of_max_multiply_different_gran3_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "function_multiply",
                "content": [
                    {
                        "type": "function_max",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ]
                    },
                    {
                        "type": "function_min",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    },
                    {
                        "type": "function_stddev_samp",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "aggregateBy": [
                                "zsj_desc.kod_zsj_d"
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Rounding aggregation

JSON
{
    "name": "can_19328_1",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "property",
                "value": "customers.lat"
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Rounding aggregation

JSON
{
    "name": "can_19328_2",
    "type": "metric",
    "content": {
        "type": "function_round",
        "content": [
            {
                "type": "property",
                "value": "customers.lng"
            }
        ],
        "options": {
            "places": 1
        }
    }
}

Multiplication of aggregations

JSON
{
    "name": "can_19328_3",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_greatest",
                "content": [
                    {
                        "type": "function_multiply",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            },
                            {
                                "type": "number",
                                "value": 0.5
                            }
                        ]
                    },
                    {
                        "type": "function_plus",
                        "content": [
                            {
                                "type": "function_max",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            },
                            {
                                "type": "number",
                                "value": 1.0E-12
                            }
                        ]
                    }
                ]
            },
            {
                "type": "function_minus",
                "content": [
                    {
                        "type": "number",
                        "value": 1.0
                    },
                    {
                        "type": "function_exp",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "function_ln",
                                        "content": [
                                            {
                                                "type": "function_greatest",
                                                "content": [
                                                    {
                                                        "type": "function_minus",
                                                        "content": [
                                                            {
                                                                "type": "number",
                                                                "value": 1.0
                                                            },
                                                            {
                                                                "type": "function_divide",
                                                                "content": [
                                                                    {
                                                                        "type": "function_sum",
                                                                        "content": [
                                                                            {
                                                                                "type": "property",
                                                                                "value": "transactions.value"
                                                                            }
                                                                        ],
                                                                        "options": {
                                                                            "aggregateBy": [
                                                                                "transactions.identifier"
                                                                            ]
                                                                        }
                                                                    },
                                                                    {
                                                                        "type": "function_greatest",
                                                                        "content": [
                                                                            {
                                                                                "type": "function_multiply",
                                                                                "content": [
                                                                                    {
                                                                                        "type": "function_sum",
                                                                                        "content": [
                                                                                            {
                                                                                                "type": "property",
                                                                                                "value": "transactions.value"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "type": "number",
                                                                                        "value": 0.5
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "type": "function_multiply",
                                                                                "content": [
                                                                                    {
                                                                                        "type": "function_sum",
                                                                                        "content": [
                                                                                            {
                                                                                                "type": "property",
                                                                                                "value": "transactions.value"
                                                                                            }
                                                                                        ],
                                                                                        "options": {
                                                                                            "aggregateBy": [
                                                                                                "transactions.identifier"
                                                                                            ]
                                                                                        }
                                                                                    },
                                                                                    {
                                                                                        "type": "number",
                                                                                        "value": 1.0E-12
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "type": "number",
                                                        "value": 1.0E-12
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Multiplication of aggregations

JSON
{
    "name": "can_19249_1",
    "type": "metric",
    "content": {
        "type": "function_multiply",
        "content": [
            {
                "type": "function_greatest",
                "content": [
                    {
                        "type": "function_multiply",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            },
                            {
                                "type": "number",
                                "value": 0.5
                            }
                        ]
                    },
                    {
                        "type": "function_plus",
                        "content": [
                            {
                                "type": "function_max",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ]
                            },
                            {
                                "type": "number",
                                "value": 1.0E-12
                            }
                        ]
                    }
                ]
            },
            {
                "type": "function_minus",
                "content": [
                    {
                        "type": "number",
                        "value": 1.0
                    },
                    {
                        "type": "function_exp",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "function_ln",
                                        "content": [
                                            {
                                                "type": "function_greatest",
                                                "content": [
                                                    {
                                                        "type": "function_minus",
                                                        "content": [
                                                            {
                                                                "type": "number",
                                                                "value": 1.0
                                                            },
                                                            {
                                                                "type": "function_divide",
                                                                "content": [
                                                                    {
                                                                        "type": "function_sum",
                                                                        "content": [
                                                                            {
                                                                                "type": "property",
                                                                                "value": "transactions.value"
                                                                            }
                                                                        ],
                                                                        "options": {
                                                                            "aggregateBy": [
                                                                                "transactions.identifier"
                                                                            ]
                                                                        }
                                                                    },
                                                                    {
                                                                        "type": "function_greatest",
                                                                        "content": [
                                                                            {
                                                                                "type": "function_multiply",
                                                                                "content": [
                                                                                    {
                                                                                        "type": "function_sum",
                                                                                        "content": [
                                                                                            {
                                                                                                "type": "property",
                                                                                                "value": "transactions.value"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "type": "number",
                                                                                        "value": 0.5
                                                                                    }
                                                                                ]
                                                                            },
                                                                            {
                                                                                "type": "function_multiply",
                                                                                "content": [
                                                                                    {
                                                                                        "type": "function_sum",
                                                                                        "content": [
                                                                                            {
                                                                                                "type": "property",
                                                                                                "value": "transactions.value"
                                                                                            }
                                                                                        ],
                                                                                        "options": {
                                                                                            "aggregateBy": [
                                                                                                "transactions.identifier"
                                                                                            ]
                                                                                        }
                                                                                    },
                                                                                    {
                                                                                        "type": "number",
                                                                                        "value": 1.0E-12
                                                                                    }
                                                                                ]
                                                                            }
                                                                        ]
                                                                    }
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "type": "number",
                                                        "value": 1.0E-12
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_two_properties_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "filter_by_boolean_two_datasets_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "sort_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Addition ofs with equality filter

JSON
{
    "name": "sort_null_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 101,
                                    "operator": "eq"
                                }
                            ]
                        }
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "eq"
                        }
                    ]
                }
            }
        ]
    }
}

Percentile with equality filter

JSON
{
    "name": "sort_null_2",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Rank with equality filter

JSON
{
    "name": "sort_null_3",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Addition ofs with equality filter

JSON
{
    "name": "sort_null_asc_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 101,
                                    "operator": "eq"
                                }
                            ]
                        }
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "eq"
                        }
                    ]
                }
            }
        ]
    }
}

Percentile with equality filter

JSON
{
    "name": "sort_null_asc_2",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Rank with equality filter

JSON
{
    "name": "sort_null_asc_3",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Addition ofs with equality filter

JSON
{
    "name": "sort_null_inverse_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 101,
                                    "operator": "eq"
                                }
                            ]
                        }
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "eq"
                        }
                    ]
                }
            }
        ]
    }
}

Percentile with equality filter

JSON
{
    "name": "sort_null_inverse_2",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "asc"
        }
    }
}

Rank with equality filter

JSON
{
    "name": "sort_null_inverse_3",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "asc"
        }
    }
}

Sum aggregation

JSON
{
    "name": "sort_external_property_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Sum aggregation

JSON
{
    "name": "sort_combined_1",
    "type": "metric",
    "content": {
        "type": "function_sum",
        "content": [
            {
                "type": "property",
                "value": "transactions.value"
            }
        ]
    }
}

Addition ofs with equality filter

JSON
{
    "name": "sort_asc_nulls_last_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 101,
                                    "operator": "eq"
                                }
                            ]
                        }
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "eq"
                        }
                    ]
                }
            }
        ]
    }
}

Percentile with equality filter

JSON
{
    "name": "sort_asc_nulls_last_2",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Rank with equality filter

JSON
{
    "name": "sort_asc_nulls_last_3",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Addition ofs with equality filter

JSON
{
    "name": "sort_asc_nulls_first_1",
    "type": "metric",
    "content": {
        "type": "function_plus",
        "content": [
            {
                "type": "function_ifnull",
                "content": [
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 101,
                                    "operator": "eq"
                                }
                            ]
                        }
                    },
                    {
                        "type": "number",
                        "value": 0.0
                    }
                ]
            },
            {
                "type": "function_sum",
                "content": [
                    {
                        "type": "property",
                        "value": "transactions.value"
                    }
                ],
                "options": {
                    "filterBy": [
                        {
                            "property": "transactions.store_id",
                            "value": 102,
                            "operator": "eq"
                        }
                    ]
                }
            }
        ]
    }
}

Percentile with equality filter

JSON
{
    "name": "sort_asc_nulls_first_2",
    "type": "metric",
    "content": {
        "type": "function_percentile",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Rank with equality filter

JSON
{
    "name": "sort_asc_nulls_first_3",
    "type": "metric",
    "content": {
        "type": "function_rank",
        "content": [
            {
                "type": "function_plus",
                "content": [
                    {
                        "type": "function_ifnull",
                        "content": [
                            {
                                "type": "function_sum",
                                "content": [
                                    {
                                        "type": "property",
                                        "value": "transactions.value"
                                    }
                                ],
                                "options": {
                                    "filterBy": [
                                        {
                                            "property": "transactions.store_id",
                                            "value": 101,
                                            "operator": "eq"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "number",
                                "value": 0.0
                            }
                        ]
                    },
                    {
                        "type": "function_sum",
                        "content": [
                            {
                                "type": "property",
                                "value": "transactions.value"
                            }
                        ],
                        "options": {
                            "filterBy": [
                                {
                                    "property": "transactions.store_id",
                                    "value": 102,
                                    "operator": "eq"
                                }
                            ]
                        }
                    }
                ]
            }
        ],
        "options": {
            "sort": "desc"
        }
    }
}

Division reusing metrics

JSON
{
    "name": "expand_metric_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "metric",
                "metric": "/rest/projects/test_query_service/md/metrics?name=turnover_metric"
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

Division reusing metrics

JSON
{
    "name": "expand_inattribute_metric_1",
    "type": "metric",
    "content": {
        "type": "function_divide",
        "content": [
            {
                "type": "metric",
                "metric": "/rest/projects/test_query_service/md/metrics?name=turnover_metric"
            },
            {
                "type": "number",
                "value": 1000.0
            }
        ]
    }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.