I’m using a Views conditional field to display the result of a global math expression field if a specific choice is made from a drop-down.
For example, I would have a decimal field with the number 1000, I use a global math expression to compute [decimal field]/2 and display the result 500 in a column. Then I use a views conditional field [expression] to place that result in a column for “John” if John is the selection from a drop-down. So far so good, I have a running column of computed values and a condition that assigns that value to Johns column if he is indicated as the owner.
Now, I want to use another global math expression to add that [expression] result in John’s column to another numeric field. The problem is that the value in [expression] shown by the conditional field is not being evaluated in the math and is treated as a null/zero. So, for instance, if I was calculating John’s sales tax, I would use a global math field to do [expression]*1.08 to give a result total including 8% sales tax. But I’m getting zero. If I substitute the conditional result [expression] with a numeric field it works. It behaves as if the conditional result is evaluated as a string and not a number.
If this is correct functionality, is there a way to convert the number appearing in the conditional field result to an actual numeric value that can be operated in a math calculation? Is there an operator, such as val() or int() that could be applied to the field reference to force a number in the global math expression?
I’m using D7 with Views 3.
Thanks in advance