I have a shapefile "ElementaryStudents" which has around 40,000 records in it. I also have a shapefile "ElementarySchools" which has 66 records in it. I want Network Analyst to calculate all of the routes from each student's residence to their school so that I can find the median distance for all students at each school. I have tried to do the field mapping and it wants to make each student's residence a stop on a route for all students assigned to a school. So, I end up with hundreds of stops for each school. I only want two stops. Student's residence as stop one and the assigned school as stop two. The result would have the number of routes equal to the number of elementary students.
I apologize if this is a redundant question, but I can't find a solution. I have tried so many combinations of field maps with no success.
You CAN use the Route tool to do this. Use the RouteName field in field mapping. You will need a separate, unique RouteName for each student, and you will need a separate copy of the student's school for each student that has the RouteName assigned to it. Naturally, this significantly increases the size of your input data. With so many students, you'll probably want to break it up into chunks. You can automate your workflow using python or ModelBuilder if you don't want to run each chunk manually.