Hello Nicholas,
Sorry for the late reply.
Thanks for the clear explanation. I think I understand what you're trying to do. Let me know if I miss the mark.
How I would handle this join involves two steps:
1) Sum up the FrequencyTable by Switch Name and get a count for each phase type. The desired result is a table of SwitchName going down with the associated counts. We're shooting for something like:
SwitchName,A_Count,B_Count,AB_Count,AC_Count,ABC_Count
406,84,0,2,55,7
407,5,0,12,0,0
408,2,31,3,0,0
This step is actually pretty difficult (unless I'm missing something) and you could use a data management software. A pivot table should do the trick (in excel or arcmap). I think the ArcMap version requires special license (which I don't have). It's pretty easy to do it in excel (see screenshot below):
i) get your data into excel
ii) 'Insert' tab > 'Pivot Table'
iii) select data
iv) check on the SwitchName, phaseCode and ObjectID (or and other field with no empty values)
v) move phaseCode to Column Labels, move SwitchName to Row Labels and move ObjectID to Values
vi) click on ObjectID under Values and click 'Value Field Settings'. Make sure you are getting a count and not a sum
vii) make sure you total is what you expected (total number of records in Frequency table)
Alternatively you could use python. I was playing around with it and one way to do it is to make a dictionary of dictionaries. The main dictionary would have a key of SwitchName and a value of another dictionary. The inset dictionary would have a key of phaseCode and a value of a count of occurrences. The script ended up being pretty long and bloated, so I think excel is a better bet (if possible).
2) Join the table from 1) to the line shapefile with SwitchName. It should be a one-to-one join.
Let me know if this works for you (or if it works at all). Good luck!