Please see the following response from SPA Specialist, Rajendra Dangol:
You need to count the no. of providers with ANC in-service training in facility level, then only merge with inventory data file as necessary to get the result. Following is the logic we have used in CSPro to get this indicator. Please also see the note from table 6.2 below. I hope this helps you replicate the table in Stata.
haveanc=(Q102(5)=1 & Q1401 in 1:31,missing);
if haveanc & P500 in 1:3 then {anc services for T6.2, T6.17}
{for t6.2 - cntanc2}
if count(P502000 where P502=1) or P505(1)=1 or P505(5)=1 or P206(5)=1 then
cntanc2=cntanc2+1;
endif;
endif;
Facility has at least one interviewed staff member providing ANC services who reports receiving in-service training in some aspect of antenatal care during the 24 months preceding the survey. The training must have involved structured sessions; it does not include individual instruction that a provider might have received during routine supervision.