Hi laura,
If i understand your case well;
you can not use logic in your xpath, therefore you have to do it before;
in this case:
["If January (which is an attribute of the entity PL) is empty, set it to 0"]
you could do something like:
MF: valueJan[create an integer based on the attribute of entity pl, if empty make it 0] -> use valueJan in your xpath
I wonder whether the technical implementation of a calculated attribute is the right thing here (i usually don't use it, seen the calculations will be done everywhere where the object is used, even when you don't need the updated values for the attributes, so you should consider that very well, but there are certainly cases), besides that you can also consider setting empty values to 0 in your on leave mf.
Can't you change your calculated values to Stored('normal') attributes, and calculate them via a "before commit" eventhandler? Since a datagrid fires a commit after leaving an editable field, this should work too right?
Or am I misinterpreting your question?