Its good he got you out of a hole, but you need to find what got you there or it will happen again.
As crasher said these systems are complicated.
From my web surfing to keep on top of theses things a fault will often trigger a code of a subsystem.
For example a cracked or removed DPF will allow more airflow and trip an EGR insufficient flow as there is not enough back pressure to crate the flow.
You could map it out but the fault will remain. O'Rileys, from memory, covered an A4 I think, that ran fine but its MPG was low teens. the fault was a gutted DPF that was mapped out, probably due to not doing a regen for what ever reason.