Variable weights in a weighted average

Discussion created by jstruve on Dec 13, 2013
Latest reply on Dec 27, 2013 by jstruve
Good morning,

I am using the field calculator to calculate a weighted average of two fields and would like to be able to change the weights.

Something like this:
w_1 = 1/2
w_2 = 1/2

[Field_1]*w1+ [Field_2]*w_2

I can get [Field_1]*1/2+ [Field_2]*1/2 to work, but not the above. How do I put the weights into my expression ? Thanks a lot for suggestions, I am new to this.