It appears that I am not understanding something or your sample doesnt show us some examples of "number of elapsed working days based on Material + actually linked Batch + Highest iteration + "Ok" Status."