Lets say I have three fields:

  • Field1 (a decimal)
  • Field2 (another decimal)
  • Global Math Expression

And in Global math expression I want to calculate [field1] + [field2]. How do I force Views to understand the replacement fields used in this global math expressions as numbers for calculation? As it is, it always returns the value 0.

2 Answers 2


Another solution that worked for me is to "Strip HTML tags": Rewrite results --> [x] Strip HTML tags


As your field are coming as "strings" in the replacement pattern, you must output the both fields as numeric. Go to your individual fields and then to "rewrite results" and in rewrite results section, go inside replacement patterns. There must be a "raw field format" display option . Just output both fields as "raw". This will enforce the fields to display without any strings and they appear as raw numbers. Then exclude both fields from the display and then do calculation in Math Expression field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.