Child table calculation on selected values

I want to calculate the multiplication of attribute value of pc-stack and pc-packing in a field outside the child table(Item Variant Attribute).I know how to set the value , but how to calculate the multiplication of only these two values of two rows.
Here is the child table