just an idea no expert here, but would you be able to use the left function to seperate out the first 3 characters of code in the table.
if would be like =left(b2,3)
this assuming that code starts at b2 and just drag down. This would provide you with an extra field that would have to be named. but it could be used in the page field property of your pivot table or dragged around the pivot table to whatever view you would like