How to assign a value to my field and calculate total?