Sorry but that calc is a nightmare. Do you receive this file from external source as unrelated to begin with?
It would be far more efficient and more relationally sound if you use temporary relationship to identify the true relationship and then join using real keys. Portal filters do not filter the relationship ... all related records are evaluated then DISPLAY is restricted in the portal. :-)
Hi LaRetta.. thanks for your suggestion... I have now decided to use a bit of ExecuteSQL on the matter ! :-D