---
title: "(EXPERIMENTAL) Compute key driver analysis"
method: POST
path: "/api/v1/actions/workspaces/{workspaceId}/execution/computeKeyDrivers"
tags: ["Computation"]
---

# (EXPERIMENTAL) Compute key driver analysis

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

## Request

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

(EXPERIMENTAL) Computes key driver analysis for the provided execution definition.

## Path parameters

- `workspaceId` string, required

## Headers

- `skip-cache` boolean

## Request body

- KeyDriversRequest
  - `auxMetrics` MeasureItem[]: Additional metrics to be included in the computation, but excluded from the analysis.
    - `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.
  - `metric` MeasureItem, required: Metric is a quantity that is calculated from the data.
    - `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.
  - `sortDirection` 'ASC' | 'DESC': Sorting elements - ascending/descending order.

## Response `200`

OK

- KeyDriversResponse
  - `dimensions` KeyDriversDimension[], required
    - `attribute` RestApiIdentifier, required: Object identifier.
      - `id` string, required
      - `type` string, required
    - `attributeName` string, required
    - `format` AttributeFormat: Attribute format describes formatting information to effectively format attribute values when needed.
      - `locale` string, required: Format locale code like 'en-US', 'cs-CZ', etc.
      - `pattern` string, required: ICU formatting pattern like 'y', 'dd.MM.y', etc.
      - `timezone` string: Timezone for date formatting like 'America/New_York', 'Europe/Prague', etc.
    - `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'
    - `label` RestApiIdentifier, required: Object identifier.
      - `id` string, required
      - `type` string, required
    - `labelName` string, required
    - `valueType` 'TEXT' | 'HYPERLINK' | 'GEO' | 'GEO_LONGITUDE' | 'GEO_LATITUDE' | 'GEO_AREA' | 'GEO_ICON' | 'IMAGE' | 'HYPERLOGLOG'
  - `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)
