> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# applyRatioRule()

- Package: [@gooddata/sdk-model](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-model/src/execution/buckets/index.ts

Applies compute ratio rule to all measures in a list.

**Signature:**

```typescript
export declare function applyRatioRule<T extends IAttributeOrMeasure>(items: T[], rule?: ComputeRatioRule): T[];
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| items | T[] | list of attributes or measures to sanitize; attributes will be lef |
| rule | [ComputeRatioRule](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.computeratiorule/index.md) | _(Optional)_ rule to apply; see [ComputeRatioRule](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.computeratiorule/index.md) |

**Returns:**

T[]

new list with modified measures; the original list and measures in it are left intact

## Remarks

This MAY be done to sanitize measure definitions so that the computed results make sense when visualized in a chart.

The function will return a new list with updated measures according to the specified rule; see [ComputeRatioRule](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.computeratiorule/index.md).

For convenience this function can work with list of measures AND attributes; attributes will be ignored in processing and kept in resulting array as-is.
