---
title: "(BETA) Outlier Detection"
method: POST
path: "/api/v1/actions/workspaces/{workspaceId}/execution/detectOutliers"
tags: ["Computation"]
---

# (BETA) Outlier Detection

`POST /api/v1/actions/workspaces/{workspaceId}/execution/detectOutliers`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/actions/workspaces/{workspaceId}/execution/detectOutliers`
- Auth: none declared

(BETA) Computes outlier detection for the provided execution definition.

## Path parameters

- `workspaceId` string, required

## Headers

- `skip-cache` boolean

## Request body

- OutlierDetectionRequest
  - `attributes` AttributeItem[], required: Attributes to be used in the computation.
    - `label` AfmObjectIdentifierLabel, required
      - `identifier` object, required
        - `id` string, required
        - `type` 'label' | 'computedAttribute', required
    - `localIdentifier` string, required: Local identifier of the attribute. This can be used to reference the attribute in other parts of the execution definition.
    - `showAllValues` boolean: Indicates whether to show all values of given attribute even if the data bound to those values is not available.
  - `auxMeasures` MeasureItem[]: Metrics to be referenced from other AFM objects (e.g. filters) but not included in the result.
    - `definition` union, required: Abstract metric definition type
      - object: Metric defined by the raw MAQL query.
        - `inline` object, required
          - `maql` string, required: MAQL query defining the metric.
      - object: Metric representing arithmetics between other metrics.
        - `arithmeticMeasure` object, required
          - `measureIdentifiers` AfmLocalIdentifier[], required: List of metrics to apply arithmetic operation by chosen operator.
            - `localIdentifier` string, required
          - `operator` 'SUM' | 'DIFFERENCE' | 'MULTIPLICATION' | 'RATIO' | 'CHANGE', required: Arithmetic operator describing operation between metrics.
      - object: Metric defined by referencing a MAQL metric or an LDM fact object with aggregation.
        - `measure` object, required
          - `aggregation` 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'RUNSUM' | 'APPROXIMATE_COUNT': Definition of aggregation type of the metric.
          - `computeRatio` boolean: If true, compute the percentage of given metric values (broken down by AFM attributes) to the total (not broken down).
          - `filters` FilterDefinitionForSimpleMeasure[]: Metrics can be filtered by attribute filters with the same interface as ones for global AFM. Note that only one DateFilter is allowed.
            - union: Abstract filter definition type for simple metric.
              - …
          - `item` AfmObjectIdentifierCore, required: Reference to the metric, fact or attribute object to use for the metric.
            - `identifier` object, required
              - …
      - PopDatasetMeasureDefinition: Previous period type of metric.
        - `previousPeriodMeasure` object, required
          - `dateDatasets` PopDataset[], required: Specification of which date data sets to use for determining the period to calculate the previous period for.
            - `dataset` AfmObjectIdentifierDataset, required: Reference to the date dataset to which the filter should be applied.
              - …
            - `periodsAgo` integer, required: Number of periods ago to calculate the previous period for.
          - `measureIdentifier` AfmLocalIdentifier, required: Local reference: ``{"localIdentifier": "..."}``.
            - `localIdentifier` string, required
      - PopDateMeasureDefinition: Period over period type of metric.
        - `overPeriodMeasure` object, required
          - `dateAttributes` PopDate[], required: Attributes to use for determining the period to calculate the PoP for.
            - `attribute` AfmObjectIdentifierAttribute, required: Reference to the date attribute to use.
              - …
            - `periodsAgo` integer, required: Number of periods ago to calculate the previous period for.
          - `measureIdentifier` AfmLocalIdentifier, required: Local reference: ``{"localIdentifier": "..."}``.
            - `localIdentifier` string, required
    - `localIdentifier` string, required: Local identifier of the metric. This can be used to reference the metric in other parts of the execution definition.
  - `filters` FilterDefinition[]: Various filter types to filter the execution result.
    - union: Abstract filter definition type
      - object: Filter in form of direct MAQL query.
        - `inline` InlineFilterDefinitionBody, required
          - `applyOnResult` boolean
          - `filter` string, required
          - `localIdentifier` string
      - object: Filter the result on top/bottom N values according to given metric(s).
        - `rankingFilter` RankingFilterBody, required
          - `applyOnResult` boolean
          - `dimensionality` union[]
            - union
              - …
          - `localIdentifier` string
          - `measures` union[], required
            - union
              - …
          - `operator` 'TOP' | 'BOTTOM', required
          - `value` integer, required
      - object: Filter the result by comparing specified metric to given constant value, using given comparison operator.
        - `comparisonMeasureValueFilter` ComparisonMeasureValueFilterBody, required
          - `applyOnResult` boolean
          - `dimensionality` union[]
            - union
              - …
          - `localIdentifier` string
          - `measure` union, required
            - AfmObjectIdentifier: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
              - …
            - AfmLocalIdentifier: Local reference: ``{"localIdentifier": "..."}``.
              - …
          - `operator` 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL_TO' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL_TO' | 'EQUAL_TO' | 'NOT_EQUAL_TO', required
          - `treatNullValuesAs` number
          - `value` number, required
      - object: Filter the result by comparing specified metric to given range of values.
        - `rangeMeasureValueFilter` RangeMeasureValueFilterBody, required
          - `applyOnResult` boolean
          - `dimensionality` union[]
            - union
              - …
          - `from` number, required
          - `localIdentifier` string
          - `measure` union, required
            - AfmObjectIdentifier: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
              - …
            - AfmLocalIdentifier: Local reference: ``{"localIdentifier": "..."}``.
              - …
          - `operator` 'BETWEEN' | 'NOT_BETWEEN', required
          - `to` number, required
          - `treatNullValuesAs` number
      - object: Filter the result by applying multiple comparison and/or range conditions combined with OR logic. If conditions list is empty, no filtering is applied (all rows are returned).
        - `compoundMeasureValueFilter` CompoundMeasureValueFilterBody, required
          - `applyOnResult` boolean
          - `conditions` union[], required
            - union
              - …
          - `dimensionality` union[]
            - union
              - …
          - `localIdentifier` string
          - `measure` union, required
            - AfmObjectIdentifier: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
              - …
            - AfmLocalIdentifier: Local reference: ``{"localIdentifier": "..."}``.
              - …
          - `treatNullValuesAs` number
      - object: A datetime filter specifying exact from and to values.
        - `absoluteDateFilter` AbsoluteDateFilterBody, required
          - `applyOnResult` boolean
          - `dataset` AfmObjectIdentifier, required: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
            - `identifier` AfmObjectIdentifierBody, required
              - …
          - `emptyValueHandling` 'INCLUDE' | 'EXCLUDE' | 'ONLY'
          - `from` string, required
          - `localIdentifier` string
          - `to` string, required
      - object: An absolute date range filter defined at a specific granularity. The 'from'/'to' literals must match the format of the chosen granularity (e.g. '2020' for YEAR, '2012-05' for MONTH, '2012-3' for QUARTER, '1996-01' for WEEK, '2010-10-30' for DAY, '2010-10-30 13' for HOUR, '2010-10-30 13:30' for MINUTE, '2010-10-30 13:30:45' for SECOND, or a plain ordinal like '6' for periodical granularities such as MONTH_OF_YEAR). At least one of 'from'/'to' must be provided; specifying only one yields an open-ended range.
        - `absoluteGranularityDateFilter` object, required
          - `applyOnResult` boolean
          - `dataset` AfmObjectIdentifierDataset, required: Reference to the date dataset to which the filter should be applied.
            - `identifier` object, required
              - …
          - `emptyValueHandling` 'INCLUDE' | 'EXCLUDE' | 'ONLY': Specifies how rows with empty (null/missing) date values should be handled. INCLUDE includes empty dates in addition to the date range restriction, EXCLUDE removes rows with empty dates (default), ONLY keeps only rows with empty dates.
          - `from` string, nullable: Start of the range (including), in the format matching 'granularity'. If omitted, the range is unbounded at the start.
          - `granularity` 'SECOND' | 'SECOND_OF_MINUTE' | 'SECOND_OF_DAY' | 'MINUTE' | 'MINUTE_OF_HOUR' | 'MINUTE_OF_DAY' | 'HOUR' | 'HOUR_OF_DAY' | 'DAY' | 'DAY_OF_WEEK' | 'DAY_OF_MONTH' | 'DAY_OF_QUARTER' | 'DAY_OF_YEAR' | 'WEEK' | 'WEEK_OF_YEAR' | 'MONTH' | 'MONTH_OF_YEAR' | 'QUARTER' | 'QUARTER_OF_YEAR' | 'YEAR' | 'FISCAL_DAY_OF_FISCAL_WEEK' | 'FISCAL_DAY_OF_FISCAL_MONTH' | 'FISCAL_DAY_OF_FISCAL_QUARTER' | 'FISCAL_DAY_OF_FISCAL_SEMESTER' | 'FISCAL_DAY_OF_FISCAL_YEAR' | 'FISCAL_WEEK' | 'FISCAL_WEEK_OF_FISCAL_MONTH' | 'FISCAL_WEEK_OF_FISCAL_QUARTER' | 'FISCAL_WEEK_OF_FISCAL_SEMESTER' | 'FISCAL_WEEK_OF_FISCAL_YEAR' | 'FISCAL_MONTH' | 'FISCAL_MONTH_OF_FISCAL_QUARTER' | 'FISCAL_MONTH_OF_FISCAL_SEMESTER' | 'FISCAL_MONTH_OF_FISCAL_YEAR' | 'FISCAL_QUARTER' | 'FISCAL_QUARTER_OF_FISCAL_SEMESTER' | 'FISCAL_QUARTER_OF_FISCAL_YEAR' | 'FISCAL_SEMESTER' | 'FISCAL_SEMESTER_OF_FISCAL_YEAR' | 'FISCAL_YEAR', required: Granularity determining the filtered date attribute and the expected 'from'/'to' format.
          - `localIdentifier` string
          - `to` string, nullable: End of the range (including), in the format matching 'granularity'. If omitted, the range is unbounded at the end.
      - object: A date filter specifying a time interval that is relative to the current date. For example, last week, next month, and so on. Field dataset is representing qualifier of date dimension. The 'from' and 'to' properties mark the boundaries of the interval. If 'from' is omitted, all values earlier than 'to' are included. If 'to' is omitted, all values later than 'from' are included. It is not allowed to omit both.
        - `relativeDateFilter` RelativeDateFilterBody, required
          - `applyOnResult` boolean
          - `boundedFilter` BoundedFilter: Bounding filter for this relative date filter. This can be used to limit the range of the relative date filter to a specific date range.
            - `from` integer, nullable: Start of the filtering interval. Specified by number of periods (with respect to given granularity). Typically negative (historical time interval like -2 for '2 days/weeks, ... ago'). If null, then start of the range is unbounded.
            - `granularity` 'SECOND' | 'SECOND_OF_MINUTE' | 'SECOND_OF_DAY' | 'MINUTE' | 'MINUTE_OF_DAY' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR' | 'MINUTE_OF_HOUR' | 'HOUR_OF_DAY' | 'DAY_OF_WEEK' | 'DAY_OF_MONTH' | 'DAY_OF_QUARTER' | 'DAY_OF_YEAR' | 'WEEK_OF_YEAR' | 'MONTH_OF_YEAR' | 'QUARTER_OF_YEAR' | 'FISCAL_DAY_OF_FISCAL_WEEK' | 'FISCAL_DAY_OF_FISCAL_MONTH' | 'FISCAL_DAY_OF_FISCAL_QUARTER' | 'FISCAL_DAY_OF_FISCAL_SEMESTER' | 'FISCAL_DAY_OF_FISCAL_YEAR' | 'FISCAL_WEEK' | 'FISCAL_WEEK_OF_FISCAL_MONTH' | 'FISCAL_WEEK_OF_FISCAL_QUARTER' | 'FISCAL_WEEK_OF_FISCAL_SEMESTER' | 'FISCAL_WEEK_OF_FISCAL_YEAR' | 'FISCAL_MONTH' | 'FISCAL_MONTH_OF_FISCAL_QUARTER' | 'FISCAL_MONTH_OF_FISCAL_SEMESTER' | 'FISCAL_MONTH_OF_FISCAL_YEAR' | 'FISCAL_QUARTER' | 'FISCAL_QUARTER_OF_FISCAL_SEMESTER' | 'FISCAL_QUARTER_OF_FISCAL_YEAR' | 'FISCAL_SEMESTER' | 'FISCAL_SEMESTER_OF_FISCAL_YEAR' | 'FISCAL_YEAR', required
            - `to` integer, nullable: End of the filtering interval. Specified by number of periods (with respect to given granularity). Value 'O' is representing current time-interval (current day, week, ...). If null, then end of the range is unbounded.
          - `dataset` AfmObjectIdentifier, required: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
            - `identifier` AfmObjectIdentifierBody, required
              - …
          - `emptyValueHandling` 'INCLUDE' | 'EXCLUDE' | 'ONLY'
          - `from` integer, required
          - `granularity` 'SECOND' | 'SECOND_OF_MINUTE' | 'SECOND_OF_DAY' | 'MINUTE' | 'MINUTE_OF_DAY' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR' | 'MINUTE_OF_HOUR' | 'HOUR_OF_DAY' | 'DAY_OF_WEEK' | 'DAY_OF_MONTH' | 'DAY_OF_QUARTER' | 'DAY_OF_YEAR' | 'WEEK_OF_YEAR' | 'MONTH_OF_YEAR' | 'QUARTER_OF_YEAR' | 'FISCAL_DAY_OF_FISCAL_WEEK' | 'FISCAL_DAY_OF_FISCAL_MONTH' | 'FISCAL_DAY_OF_FISCAL_QUARTER' | 'FISCAL_DAY_OF_FISCAL_SEMESTER' | 'FISCAL_DAY_OF_FISCAL_YEAR' | 'FISCAL_WEEK' | 'FISCAL_WEEK_OF_FISCAL_MONTH' | 'FISCAL_WEEK_OF_FISCAL_QUARTER' | 'FISCAL_WEEK_OF_FISCAL_SEMESTER' | 'FISCAL_WEEK_OF_FISCAL_YEAR' | 'FISCAL_MONTH' | 'FISCAL_MONTH_OF_FISCAL_QUARTER' | 'FISCAL_MONTH_OF_FISCAL_SEMESTER' | 'FISCAL_MONTH_OF_FISCAL_YEAR' | 'FISCAL_QUARTER' | 'FISCAL_QUARTER_OF_FISCAL_SEMESTER' | 'FISCAL_QUARTER_OF_FISCAL_YEAR' | 'FISCAL_SEMESTER' | 'FISCAL_SEMESTER_OF_FISCAL_YEAR' | 'FISCAL_YEAR', required
          - `localIdentifier` string
          - `to` integer, required
      - object: An all-time date filter that does not restrict by date range. Controls how rows with empty (null/missing) date values are handled.
        - `allTimeDateFilter` AllTimeDateFilterBody, required
          - `applyOnResult` boolean
          - `dataset` AfmObjectIdentifier, required: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
            - `identifier` AfmObjectIdentifierBody, required
              - …
          - `emptyValueHandling` 'INCLUDE' | 'EXCLUDE' | 'ONLY'
          - `granularity` 'SECOND' | 'SECOND_OF_MINUTE' | 'SECOND_OF_DAY' | 'MINUTE' | 'MINUTE_OF_DAY' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR' | 'MINUTE_OF_HOUR' | 'HOUR_OF_DAY' | 'DAY_OF_WEEK' | 'DAY_OF_MONTH' | 'DAY_OF_QUARTER' | 'DAY_OF_YEAR' | 'WEEK_OF_YEAR' | 'MONTH_OF_YEAR' | 'QUARTER_OF_YEAR' | 'FISCAL_DAY_OF_FISCAL_WEEK' | 'FISCAL_DAY_OF_FISCAL_MONTH' | 'FISCAL_DAY_OF_FISCAL_QUARTER' | 'FISCAL_DAY_OF_FISCAL_SEMESTER' | 'FISCAL_DAY_OF_FISCAL_YEAR' | 'FISCAL_WEEK' | 'FISCAL_WEEK_OF_FISCAL_MONTH' | 'FISCAL_WEEK_OF_FISCAL_QUARTER' | 'FISCAL_WEEK_OF_FISCAL_SEMESTER' | 'FISCAL_WEEK_OF_FISCAL_YEAR' | 'FISCAL_MONTH' | 'FISCAL_MONTH_OF_FISCAL_QUARTER' | 'FISCAL_MONTH_OF_FISCAL_SEMESTER' | 'FISCAL_MONTH_OF_FISCAL_YEAR' | 'FISCAL_QUARTER' | 'FISCAL_QUARTER_OF_FISCAL_SEMESTER' | 'FISCAL_QUARTER_OF_FISCAL_YEAR' | 'FISCAL_SEMESTER' | 'FISCAL_SEMESTER_OF_FISCAL_YEAR' | 'FISCAL_YEAR'
          - `localIdentifier` string
      - object: Filter able to limit element values by label and related selected negated elements.
        - `negativeAttributeFilter` NegativeAttributeFilterBody, required
          - `applyOnResult` boolean
          - `label` union, required
            - AfmObjectIdentifier: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
              - …
            - AfmLocalIdentifier: Local reference: ``{"localIdentifier": "..."}``.
              - …
          - `localIdentifier` string
          - `notIn` AttributeFilterElements, required: Filter on specific set of label values.
            - `values` string[], required: Set of label values.
          - `usesArbitraryValues` boolean
      - object: Filter able to limit element values by label and related selected elements.
        - `positiveAttributeFilter` PositiveAttributeFilterBody, required
          - `applyOnResult` boolean
          - `in` AttributeFilterElements, required: Filter on specific set of label values.
            - `values` string[], required: Set of label values.
          - `label` union, required
            - AfmObjectIdentifier: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
              - …
            - AfmLocalIdentifier: Local reference: ``{"localIdentifier": "..."}``.
              - …
          - `localIdentifier` string
          - `usesArbitraryValues` boolean
      - object: Filter via label with given match type and literal value.
        - `matchAttributeFilter` object, required
          - `applyOnResult` boolean
          - `caseSensitive` boolean: Indicates whether the filter match is evaluated in case-sensitive mode or not.
          - `label` union, required: Reference to the attribute label to which the filter should be applied.
            - object: ObjectIdentifier with `identifier` wrapper. This serves to distinguish MD object identifiers in AFM request from local identifiers.
              - …
            - object: Local reference: ``{"localIdentifier": "..."}``.
              - …
          - `literal` string, required: Literal used to limit label values.
          - `localIdentifier` string
          - `matchType` 'STARTS_WITH' | 'ENDS_WITH' | 'CONTAINS', required: Requested match type.
          - `negate` boolean: Indicates whether the filter should negate the match.
  - `granularity` 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR', required: Date granularity for anomaly detection. Only time-based granularities are supported (HOUR, DAY, WEEK, MONTH, QUARTER, YEAR).
  - `measures` MeasureItem[], required
    - `definition` union, required: Abstract metric definition type
      - object: Metric defined by the raw MAQL query.
        - `inline` object, required
          - `maql` string, required: MAQL query defining the metric.
      - object: Metric representing arithmetics between other metrics.
        - `arithmeticMeasure` object, required
          - `measureIdentifiers` AfmLocalIdentifier[], required: List of metrics to apply arithmetic operation by chosen operator.
            - `localIdentifier` string, required
          - `operator` 'SUM' | 'DIFFERENCE' | 'MULTIPLICATION' | 'RATIO' | 'CHANGE', required: Arithmetic operator describing operation between metrics.
      - object: Metric defined by referencing a MAQL metric or an LDM fact object with aggregation.
        - `measure` object, required
          - `aggregation` 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'RUNSUM' | 'APPROXIMATE_COUNT': Definition of aggregation type of the metric.
          - `computeRatio` boolean: If true, compute the percentage of given metric values (broken down by AFM attributes) to the total (not broken down).
          - `filters` FilterDefinitionForSimpleMeasure[]: Metrics can be filtered by attribute filters with the same interface as ones for global AFM. Note that only one DateFilter is allowed.
            - union: Abstract filter definition type for simple metric.
              - …
          - `item` AfmObjectIdentifierCore, required: Reference to the metric, fact or attribute object to use for the metric.
            - `identifier` object, required
              - …
      - PopDatasetMeasureDefinition: Previous period type of metric.
        - `previousPeriodMeasure` object, required
          - `dateDatasets` PopDataset[], required: Specification of which date data sets to use for determining the period to calculate the previous period for.
            - `dataset` AfmObjectIdentifierDataset, required: Reference to the date dataset to which the filter should be applied.
              - …
            - `periodsAgo` integer, required: Number of periods ago to calculate the previous period for.
          - `measureIdentifier` AfmLocalIdentifier, required: Local reference: ``{"localIdentifier": "..."}``.
            - `localIdentifier` string, required
      - PopDateMeasureDefinition: Period over period type of metric.
        - `overPeriodMeasure` object, required
          - `dateAttributes` PopDate[], required: Attributes to use for determining the period to calculate the PoP for.
            - `attribute` AfmObjectIdentifierAttribute, required: Reference to the date attribute to use.
              - …
            - `periodsAgo` integer, required: Number of periods ago to calculate the previous period for.
          - `measureIdentifier` AfmLocalIdentifier, required: Local reference: ``{"localIdentifier": "..."}``.
            - `localIdentifier` string, required
    - `localIdentifier` string, required: Local identifier of the metric. This can be used to reference the metric in other parts of the execution definition.
  - `sensitivity` 'LOW' | 'MEDIUM' | 'HIGH', required: Sensitivity level for outlier detection

## Response `200`

OK

- OutlierDetectionResponse
  - `links` ExecutionLinks, required: Links to the execution result.
    - `executionResult` string, required: Link to the result data.

---

[API](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/revisions/c728ef303bfb?raw)
