I have a hist_tab that is updated daily and has contract, part, family, shortage_date, and qty.
I also have the below logic which works fine. Basically for each part/pro