Hello,

I want to calculate multiple fields. Suppose I am calculating my income, expense and profit. In expense filed, I have selected "unlimited values".
In Profit field, I have given math expression =
[field_income_amount] - [field_expense_amount:0:value] - [field_expense_amount:1:value]

Now when I am calculating the below -

Income - 100
Expense (first field value) - 20
Expense (second field value) - 15

Then, profit field is showing nothing. It does not calculating.
Can anyone please tell me - how to achieve this result?

I have seen this issue https://www.drupal.org/node/2483453. But my issue is little different. Also I have noticed in the documentation -
"Other fields may be included in math expressions using tokens with the structure [$field_name:$delta:$column] where $field_name is the machine name of a supported field, $delta is the index for multivalue fields ($delta begins with 0), and $column is the column name for multicolumn fields."

But it is not working. Can anyone please help?

Comments

Sandip Choudhury created an issue. See original summary.

sandip choudhury’s picture

Issue summary: View changes
nerdstein’s picture

This is an issue with the cardinality of fields. I am hacking at this inside of this issue: https://www.drupal.org/node/2573643#comment-12056640

I suspect it will be fixed thereafter.