I have a dataset with around 4k schools for with I have their location (longitude and latitude) and enrolment which I have uploaded to a GIS map. I want to do an operation with the competing schools in a 1km radious for each school. The operation is as follows:
I have identified that I need the following steps:
- Draw a buffer of 1 km around each school
- Identify all the schools j in that area for school i
- Calculate the distance between the school i and all the schools j in the area
- Run the CI formula for school i
- Add the resulting number to the data table
- Repeat for all schools
However, I have been unable to go past the second step. How can I do this in a way that covers all the schools?

2 - Select by location https://gis.stackexchange.com/questions/61753/selecting-features-within-polygon-from-another-layer-using-qgis
3 - You can use Hub Distance in MMQGIS plugin
– hugonbg Jul 10 '18 at 14:09