> For the complete documentation index, see [llms.txt](https://docs.struct.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.struct.com/pim3/tutorials/helpful-guides/how-to-use-business-rules/how-to-automatically-calculate-the-size-of-a-variant.md).

# How to automatically calculate the size of a variant

To make a rule that will calculate the volume of a [variant](/pim3/fundamental-concepts/products-and-variants.md) based on the dimensions of that [variant](/pim3/fundamental-concepts/products-and-variants.md), make a [trigger](/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details.md) that [triggers](/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details.md) when any of the dimensions change.

<figure><img src="/files/9deeSs2iLQ51Xgc8q9zK" alt=""><figcaption><p>Business rule setup page</p></figcaption></figure>

Then add an [action](/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details.md) and choose "Calculate value". When configuring the [action](/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details.md) click "+Add math calculation" and choose "Add math operation".\
\
In this example we start by multiplying the height and width. That result is then multiplied with the length. Finally that result is multiplied with 0,001 to make sure the units are correct.&#x20;

<figure><img src="/files/ZDiaJXbLtMVuoY7a8UlY" alt=""><figcaption><p>Configure action</p></figcaption></figure>

Finally choose what [attribute](/pim3/fundamental-concepts/attributes.md) the result should be written to.

{% hint style="info" %}
**Note** By clicking the operator between the values you can choose the operator (x,/,+,-).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.struct.com/pim3/tutorials/helpful-guides/how-to-use-business-rules/how-to-automatically-calculate-the-size-of-a-variant.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
