There's more to experience when you log in!
If I see this correctly, what you are trying to do is to get the distance between 2 sets of points; that is, to output distances of every point in table1 to every point in table 2 ( N x M ). You also have a sorter in your picture but I am not sure of how you want to use that. You also mentioned that these points had an origin in MapInfo Pro. If these 2 assumptions are correct, this is how I would solve that problem. I can attach a dataflow example. It will be for version 2019.1.
The first step is to take your 2 tables (.tab files I assume) and register them with the Spatial repository in Spatial Manager. This is called "creating named tables" for the data. The 2 table can be referenced where they live and will be in a repository path of your choosing and naming. I would then use 2 spatial stages, Read Spatial Data and Query Spatial Data. In my example, which I will share the exported dataflow, I am using 2 tables in our sample data so you should be able to load and run the same flow
Read will read each record from one table (Select * from "/DistanceProject/2020/Ross" ) which is wherever you put the named tables. You can choose which fields to read out from the list and checkboxes below. Here's a picture of using * but selecting the fields you want. You can also use an explicit column name in the SQL.
Note that I have renamed the geometry fro "Obj" to "StartPt" and I have decided that while name of the city and state are interesting identifying information, the population is not so I unchecked it. You may also want some sort of key or identifier so when you output the distances you can identify which 2 points this distance represents. Spectrum Spatial supports a default key called "MI_Key" which is the .tab file rowed in this case. But it could be anything else you have in your data. Then you connect it to Query Spatial Data where you can do the next part where you also calculate the distance. For example here I have named the geometry EndPt for clarity (I could have just left it at obj as I have "startpt" to distinguish it). I then saw that I would have a field name clash with "State" from the first table so I renamed it "CapitalState" and then I removed the population field but left the FIPs_Code but no real reason.
I also changed the Distance output to DistanceMiles
The output of this could be to a text file. I also could have updated the results into a .tab file possibly creating a line between the start and end point. Again depends on what you want to do but in this flow, I output to a text file.
A sample of output. Note that the first set of results is all from New York and sorted by distance. That is because New York is the first record in the Ik city file.
DistanceMiles,Capital,CapitialState,FIPS_Code,Name,State52.313,TRENTON,NJ,34,NEW YORK,NY99.998,HARTFORD,CT,09,NEW YORK,NY134.007,DOVER,DE,10,NEW YORK,NY135.263,ALBANY,NY,36,NEW YORK,NY154.222,HARRISBURG,PA,42,NEW YORK,NY154.601,PROVIDENCE,RI,44,NEW YORK,NY178.979,ANNAPOLIS,MD,24,NEW YORK,NY190.915,BOSTON,MA,25,NEW YORK,NY202.821,WASHINGTON,DC,11,NEW YORK,NY214.559,CONCORD,NH,33,NEW YORK,NY256.078,MONTPELIER,VT,50,NEW YORK,NY287.925,RICHMOND,VA,51,NEW YORK,NY331.361,AUGUSTA,ME,23,NEW YORK,NY421.696,RALEIGH,NC,37,NEW YORK,NY437.692,CHARLESTON,WV,54,NEW YORK,NY475.346,COLUMBUS,OH,39,NEW YORK,NY560.815,LANSING,MI,26,NEW YORK,NY595.728,COLUMBIA,SC,45,NEW YORK,NYFurther down in the results are other cities also sorted by distance.356.045,PHOENIX,AZ,04,LOS ANGELES,CA359.842,SACRAMENTO,CA,06,LOS ANGELES,CA361.787,CARSON CITY,NV,32,LOS ANGELES,CA579.223,SALT LAKE CITY,UT,49,LOS ANGELES,CA668.942,BOISE,ID,16,LOS ANGELES,CA705.187,SANTA FE,NM,35,LOS ANGELES,CA792.863,SALEM,OR,41,LOS ANGELES,CA836.342,DENVER,CO,08,LOS ANGELES,CA882.906,CHEYENNE,WY,56,LOS ANGELES,CA925.872,HELENA,MT,30,LOS ANGELES,CA
I used one of the dataflow conversion options so that the distance only has 3 decimal places.
I will attach the exported dataflow (.df) file in a zip file.I will try your approach or you can share your flow. I think having 2 read from files is confusing and you would not be able to determine the order.
Eric,Thanks for walking me through your method! This makes a lot of sense and answers my question.As a follow up questions, do you think there is a way to do this without using Named Tables in the Spatial Manager? For example; starting from two geocoded .csv files, then creating point then appending the closest distances.Thanks again.