# dimensionalize (previously exact_grains) > AQL Syntax: always evaluate an expression using certain grains; Dimensionalized Measure :::info We have renamed `exact_grains` to `dimensionalize` to align with how the function is used in practice. While we will continue to support `exact_grains` for backward compatibility, please use `dimensionalize` to ensure that your code is readable. ::: ## Definition Evaluate an expression using a specific Level of Detail (LoD) context, regardless of the outer context. You can use `dimensionalize` for use cases like [dimensionalized measure](/as-code/aql/cookbook/level-of-detail#use-case-2-fixed-lod--dimensionalize) and [cohort analysis](/as-code/aql/cookbook/aql-cohort-retention). :::caution This is only allowed in the definition of a Dimension, and not elsewhere. ::: **Syntax** ```aml dimensionalize(measure, dimension, ...) ``` ```aml title="Examples" dimension order_value { description: "Total order value of this user" definition: @aql dimensionalize(sum(order_items.order_value), users.id) ;; } // with pipe dimension order_value { description: "Total order value of this user" definition: @aql sum(order_items.order_value) | dimensionalize(users.id) ;; } ``` **Input** - `measure`: A measure that you want to evaluate against a specific LoD context. - `dimension` (**repeatable**): A dimension that you want to use as the LoD context. **Output** A new dimension --- ## Sample Usages The following example creates a dimension `customer_lifetime_value`, by dimensonalizing the measure total sales ```aml dimension customer_lifetime_value { ... definition: @aql sum(orders.amount) | dimensionalize(users.id) ;; } ``` Total orders *amount* of this *user* equal to *customer lifetime value* field We can also reuse this dimension just like other dimension to derive further analytics insight. Let's define `average_customer_lifetime_value` metric ```aml metric average_customer_value { ... definition: @aql average(users.customer_lifetime_value) ;; } ``` Using the above metric to find Average Customer Lifetime Value per Continent ## See also - [`of_all()`](/reference/aql/of_all) - [`keep()`](/reference/aql/keep) - [Level of Detail](/as-code/aql/learn/level-of-detail) - [Order of Operations](/as-code/aql/order-of-operations)