correction when entities differ

It runs without error for 2006,
seems to have problem in ident in years after
need help to check with aggregates, not sure it's ok since the opt
option give a non null value for each person of a same entity. I'm not
sure it's what we want as so far the value for quifoy==1 for example was
probably null