Closed (works as designed)
Project:
Field Expression
Version:
2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2019 at 15:26 UTC
Updated:
8 Aug 2026 at 19:21 UTC
Jump to comment: Most recent
Comments
Comment #2
orkutmuratyilmazThis is really a support request rather than a feature request, so answering here and closing.
You do not need one expression field per step. The Expression (integer), Expression (decimal) and Expression (float) field types accept several statements separated by
;, variables carry across them, and the value of the last statement becomes the field value. So your whole chain fits in a single field:total = [node:field_amount] * [node:field_price]; annual = total * 12; annual - (annual * 0.10)Chaining across separate expression fields, where field D reads the value of field C, is not reliable. Each expression field evaluates in its own
preSave()and the order in which fields are processed on a single save is not something the module controls, so the field you reference may still hold its previous value. Keeping the whole calculation in one field avoids that entirely. If you do want the intermediate values visible as their own fields, enable the option to evaluate the expression when the field is rendered, which resolves tokens at display time instead of at save time.Note also that your discount formula does not do what you intend.
[field D] - ([field D] * 100 / 10)subtracts ten times the value. For a 10 percent discount use[field D] * 0.90or[field D] - ([field D] * 10 / 100).One limitation worth stating: this module evaluates tokens from the entity the field is attached to. If by "many table rows" you mean aggregating values across several entities, that is outside what this module does. Views with aggregation, or Computed Field with custom code, are the right tools for that.