--- title: "Result Of Expression | Darwinium" slug: "result-of-expression" description: "Configure Darwinium Result Of Expression features to calculate a value from query-language expressions and other feature outputs." tags: ["Feature"] updated: 2026-09-15T14:33:58Z published: 2026-09-15T14:33:58Z canonical: "docs.darwinium.com/result-of-expression" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.darwinium.com/llms.txt > Use this file to discover all available pages before exploring further. # Result Of Expression ## Find The: Result Of Expression ![Image](https://cdn.document360.io/db6f7316-640d-4099-b5a1-b01b4dbd17fc/Images/Documentation/result-of-expression_icon.png?sv=2026-02-06&spr=https&st=2026-11-22T23%3A44%3A43Z&se=2026-11-23T00%3A44%3A43Z&sr=b&sp=r&sig=Kn5UZiohWvQoS%2FtJESwieCobU5y9SiN1BurnAZ9PGvU%3D) `result_of_expression` The result of a Query-Language expression, which may combine one or more other Features with arithmetic. For example a total count Feature (velocity of device) combined with a filtered one (velocity of device where country = US) to produce the percentage of times the device has been seen in the US. ## Configuration - [Feature Name](/docs/new-features#feature-name): The "dictionary" name under which the feature value will be stored and referenced by in rules. - [Expression](/docs/new-features#expression): The Query-Language expression to evaluate. It may reference other Features. ## Optional Configuration - [Default Value](/docs/new-features#default-value): A value that can be assigned to the feature if the attributes to calculate the features are not present. - [Scope](/docs/new-features#scope): Can be used to extend the event search from the local node, to all nodes within the same organization all the way to all across customers (global). ## Use Case 1 Compare what a customer has paid in against what they have moved on. Two Statistic Of Numeric Features sum `transaction.amount` over the last week for the same customer token, one filtered to `deposit` events and one to `transfer` events, and this Feature divides the first by the second. A ratio near 1 means money is leaving about as fast as it arrives, which is what a pass-through account looks like; a high ratio means it is accumulating. The denominator is guarded, because a customer with deposits and no transfers would otherwise divide by zero: ``` if(outcome['CHAMPION'].features.general['sum_amn_for_customer_at_transfer_in7days'] > 0, outcome['CHAMPION'].features.general['sum_amn_for_customer_at_deposit_in7days'] / outcome['CHAMPION'].features.general['sum_amn_for_customer_at_transfer_in7days'], 0.0) ``` #### Using the Feature in Rules and Investigations Find a week where nearly everything paid in has already been moved on. The lower bound keeps the guard's 0 out of the rule, since 0 means there were no transfers at all. ``` feature('deposit_to_transfer_ratio') > 0 and feature('deposit_to_transfer_ratio') < 1.1 ``` #### **Implementing In The Feature Editor** ``` - name: amn_for_customer_at_deposit_in7days default_value: -1 with_scope: same_node_instance time_window: weeks: 1 starting: immediately find_the: statistic_of_numeric: attribute: transaction.amount for_events: event_type: - deposit include_current_event: true with_the_same: - identity['ACCOUNT'].customer_token.customer_token into_features: sum: sum_amn_for_customer_at_deposit_in7days - name: amn_for_customer_at_transfer_in7days default_value: -1 with_scope: same_node_instance time_window: weeks: 1 starting: immediately find_the: statistic_of_numeric: attribute: transaction.amount for_events: event_type: - transfer include_current_event: true with_the_same: - identity['ACCOUNT'].customer_token.customer_token into_features: sum: sum_amn_for_customer_at_transfer_in7days - name: deposit_to_transfer_ratio default_value: -1 with_scope: same_node_instance find_the: result_of_expression: if(outcome['CHAMPION'].features.general['sum_amn_for_customer_at_transfer_in7days'] > 0, outcome['CHAMPION'].features.general['sum_amn_for_customer_at_deposit_in7days'] / outcome['CHAMPION'].features.general['sum_amn_for_customer_at_transfer_in7days'], 0.0) ``` Note: The Features an Expression reads have to be defined in the same step, and are calculated before it runs. **Default Value only catches a result that is not a number.** `0 / 0` is not a number and falls back to it; a positive numerator over a zero denominator does not, which is why the denominator is tested rather than left to the Default Value. ## Use Case 2 Turn a filtered count and a total count into a percentage. Both are Velocity Of Features on the same identifier, one of them narrowed by a Condition, and this Feature divides one by the other. The Expression addresses each Feature by its stored name: ``` outcome['CHAMPION'].features.general['my_example_feature'] * ( 100.0 / outcome['CHAMPION'].features.general['my_total_count_feature'] ) ``` #### Using the Feature in Rules and Investigations Find events where the filtered count is less than a fifth of the total. ``` feature('result_of_expr') < 20.0 ``` #### **Implementing In The Feature Editor** ![image.png](https://cdn.document360.io/db6f7316-640d-4099-b5a1-b01b4dbd17fc/Images/Documentation/image%2849%29.png?sv=2026-02-06&spr=https&st=2026-11-22T23%3A44%3A43Z&se=2026-11-23T00%3A44%3A43Z&sr=b&sp=r&sig=E%2BSPWfLxz7SZwwrQ5WH5WLhlxO705JuRQSJz47vV3oE%3D) ``` - name: result_of_expr default_value: 0 find_the: result_of_expression: outcome['CHAMPION'].features.general['my_example_feature'] * ( 100.0 / outcome['CHAMPION'].features.general['my_total_count_feature'] ) with_scope: same_node_instance ```