> ## Documentation Index
> Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query MetricCalculation

> Query results for a single metric calculation.



## OpenAPI

````yaml /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations/{metricCalculation}:query
openapi: 3.1.0
info:
  title: Confidence Metric-calculation API
  version: 1.0.0
  description: API documentation for metric-calculation
servers: []
security: []
paths:
  /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations/{metricCalculation}:query:
    post:
      summary: Query MetricCalculation
      description: Query results for a single metric calculation.
      operationId: MetricCalculation.query
      parameters:
        - name: scheduledMetricCalculation
          in: path
          required: true
          schema:
            type: string
        - name: metricCalculation
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                groupByDimensions:
                  type: array
                  items:
                    type: string
                  description: |2-

                     magic dimensions exist for date, timestamp, hour (which is the start of the window) and group
                accumulateDimension:
                  type: string
                  description: >-
                    Dimension to accumulate for (so each entry is the sum of the
                    current entry plus the previous).
                     Assumes that this dimension is sortable
                timeZone:
                  type: string
                  description: The time zone that you want the results in.
                dimensionFilters:
                  type: array
                  items:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        allowedValues:
                          type: array
                          items:
                            type: string
                          description: >-
                            Values to be filter by. Will only match filter if
                            the dimension has one of these values.
                      required:
                        - allowedValues
                  description: Filters dimensions by included values.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  dimensions:
                    type: array
                    items:
                      type: string
                    description: >-
                      Set of all dimensions that existed in this results and can
                      be queried
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        dimensions:
                          type: array
                          items:
                            type: object
                            additionalProperties:
                              type: string
                          description: >-
                            The dimensions of this row. Magic dimensions are:
                            date, hour, timestamp and
                             group.
                        value:
                          type: object
                          properties:
                            averageSummaryStats:
                              type: object
                              properties:
                                sum:
                                  type: number
                                  description: Sum of values.
                                sumOfSquares:
                                  type: number
                                  description: |2-

                                     Sum of squared values.
                                count:
                                  type: integer
                                  description: >-
                                    Number of entities with a non-missing
                                    measurement after handling nulls.
                                countMissing:
                                  type: integer
                                  description: >-
                                    Number of entities with a missing
                                    measurement before handling nulls.
                                countMissingRows:
                                  type: integer
                                  description: >-
                                    Total number of rows with a missing
                                    measurement.
                                mean:
                                  type: number
                                  description: Mean of values.
                                variance:
                                  type: number
                                  description: Variance of values.
                                varianceReductionStats:
                                  type: object
                                  properties:
                                    count:
                                      type: integer
                                      description: >-
                                        Number of entities with a non-missing
                                        pre- and post measurement after handling
                                        nulls.
                                    countMissing:
                                      type: integer
                                      description: >-
                                        Number of entities with a missing pre-
                                        and post measurement before handling
                                        nulls.
                                    countMissingRows:
                                      type: integer
                                      description: >-
                                        Total number of rows with a missing pre
                                        exposure measurement.
                                    sum:
                                      type: number
                                      description: Sum of values.
                                    postSum:
                                      type: number
                                      description: >-
                                        Sum of post exposure measurements that
                                        had a non-missing pre exposure
                                        measurement.
                                    postCount:
                                      type: integer
                                      description: >-
                                        Count of post exposure entities that had
                                        a non-missing pre exposure measurement.
                                    sumOfSquares:
                                      type: number
                                      description: |2-

                                         Sum of squared values.
                                    sumOfProducts:
                                      type: number
                                      description: |2-

                                         Sum of product between pre and post exposure values.
                                    mean:
                                      type: number
                                      description: Mean of values.
                                    variance:
                                      type: number
                                      description: Variance of values.
                                    covariance:
                                      type: number
                                      description: >-
                                        Covariance between pre and post exposure
                                        measurements.
                                  description: Summary statistics for variance reduction.
                              description: Summary statistics for an average metric.
                            ratioSummaryStats:
                              type: object
                              properties:
                                numeratorSum:
                                  type: number
                                  description: Sum of numerator values.
                                numeratorSumOfSquares:
                                  type: number
                                  description: |2-

                                     Sum of squared numerator values.
                                denominatorSum:
                                  type: number
                                  description: Sum of denominator values.
                                denominatorSumOfSquares:
                                  type: number
                                  description: |2-

                                     Sum of squared denominator values.
                                sumOfProducts:
                                  type: number
                                  description: |2-

                                     Sum of product between numerator and denominator.
                                count:
                                  type: integer
                                  description: >-
                                    Number of entities with a non-missing
                                    numerator and denominator after handling
                                    nulls.
                                countMissing:
                                  type: integer
                                  description: >-
                                    Number of entities with a missing numerator
                                    or denominator before handling nulls.
                                countMissingRows:
                                  type: integer
                                  description: >-
                                    Total number of rows with a missing
                                    numerator or denominator.
                                numeratorMean:
                                  type: number
                                  description: Variance of the mean.
                                numeratorVariance:
                                  type: number
                                  description: Variance of the numerator.
                                denominatorMean:
                                  type: number
                                  description: Mean of the denominator.
                                denominatorVariance:
                                  type: number
                                  description: Variance of the denominator.
                                numeratorDenominatorCovariance:
                                  type: number
                                  description: >-
                                    Covariance between numerator and
                                    denominator.
                                varianceReductionStats:
                                  type: object
                                  properties:
                                    count:
                                      type: integer
                                      description: >-
                                        Number of entities with a non-missing
                                        pre exposure numerator and denominator,
                                        and
                                         non-missing post exposure numerator and denominator after handling nulls.
                                    countMissing:
                                      type: integer
                                      description: >-
                                        Number of entities with a missing pre
                                        exposure numerator or denominator before
                                        handling
                                         nulls.
                                    countMissingRows:
                                      type: integer
                                      description: >-
                                        Total number of rows with a missing pre
                                        exposure numerator or denominator.
                                    numeratorSum:
                                      type: number
                                      description: Sum of values.
                                    postNumeratorSum:
                                      type: number
                                      description: >-
                                        Sum of post exposure numerator values
                                        that had a pre exposure numerator.
                                    numeratorSumOfSquares:
                                      type: number
                                      description: |2-

                                         Sum of squared values.
                                    denominatorSum:
                                      type: number
                                      description: Sum of values.
                                    postDenominatorSum:
                                      type: number
                                      description: >-
                                        Sum of post exposure denominator values
                                        that had a pre exposure denominator.
                                    denominatorSumOfSquares:
                                      type: number
                                      description: |2-

                                         Sum of squared values.
                                    sumOfProducts:
                                      type: number
                                      description: |2-

                                         Sum of product between pre and post exposure values.
                                    numeratorNumeratorSumOfProducts:
                                      type: number
                                      description: |2-

                                         Sum of product between pre numerator and post numerator.
                                    numeratorDenominatorSumOfProducts:
                                      type: number
                                      description: |2-

                                         Sum of product between pre numerator and post denominator.
                                    denominatorNumeratorSumOfProducts:
                                      type: number
                                      description: |2-

                                         Sum of product between pre denominator and post numerator.
                                    denominatorDenominatorSumOfProducts:
                                      type: number
                                      description: |2-

                                         Sum of product between pre denominator and post denominator.
                                    numeratorMean:
                                      type: number
                                      description: Variance of the mean.
                                    numeratorVariance:
                                      type: number
                                      description: Variance of the numerator.
                                    denominatorMean:
                                      type: number
                                      description: Mean of the denominator.
                                    denominatorVariance:
                                      type: number
                                      description: Variance of the denominator.
                                    numeratorDenominatorCovariance:
                                      type: number
                                      description: >-
                                        Covariance between numerator and
                                        denominator.
                                    preNumeratorPostNumeratorCovariance:
                                      type: number
                                      description: >-
                                        Covariance between pre numerator and
                                        post numerator.
                                    preNumeratorPostDenominatorCovariance:
                                      type: number
                                      description: >-
                                        Covariance between pre numerator and
                                        post denominator.
                                    preDenominatorPostNumeratorCovariance:
                                      type: number
                                      description: >-
                                        Covariance between pre denominator and
                                        post numerator.
                                    preDenominatorPostDenominatorCovariance:
                                      type: number
                                      description: >-
                                        Covariance between pre denominator and
                                        post denominator.
                                  description: Summary statistics for variance reduction.
                              description: Summary statistics for a ratio metric.
                          description: Compute summary statistics.
                        aggCount:
                          type: object
                          description: >-
                            The number of metric calculations that were included
                            in this aggregation.
                    description: The resulting rows for the query
                  startTime:
                    type: object
                    description: The start time of the metric calculation
      security:
        - admin: []
      servers:
        - url: https://metrics.eu.confidence.dev
        - url: https://metrics.us.confidence.dev
        - url: https://metrics.confidence.dev
components:
  securitySchemes:
    admin:
      type: http
      scheme: bearer

````