Calculate field value based on another field value with Rules I am using Drupal 7 and Commerce.

I have Product display where is custom field called Stock (field_stock). This field holds stock value (integer) for Product.

In Product display I have Product Variations. Variations has custom field called Stock Value (field_stock_value).

When adding new Product display and setting field Stock to value 10. And then adding first Variation and setting field Stock Value to 6. And to second Variation field Stock Value to 4. 

I need to have rules which decreases Stock field from Product display. So it is simple: take value from Stock Value field and reduce that amount from Stock field.

But I have not succeeded to make working rules for that. Any help needed. Thanks!
Try Computed Field


  Computed Field is a very powerful CCK field module that lets you add a
  custom "computed fields" to your content types. These computed fields
  are populated with values that you define via PHP code. You may draw
  on anything available to Drupal, including other fields, the current
  user, database tables, you name it. (Feeling the power yet? :) ) You
  can also choose whether to store your computed field values in the
  database with other content fields, or have them "calculated" on the
  fly during node views. (Although you should note that Views use
  requires database stored values.) This field is literally the Swiss
  Army knife of CCK fields. So start cooking up your PHP based values!


Check Conditional Fields too 


  Define dependencies between fields based on their states and values.