Welcome to the forum. I for one don't understand the problem, largely because of your terminology I think. I know what tertiary means, but have no clue how it relates to what you're saying. If that's the data you have, then posting the desired outcome will help, but I get the impression that list is only a partial glimpse. Whatever the goal, be careful that you don't create some kind of flat, Excel type table of data, otherwise you're setting yourself up for further troubles.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.