Sorting Entries into sets based on at least one variable being the same.

I have about 70,000 entries in a csv file that have the following information:
First Name, Last Name, Email, Phone Number.

What I need to do is group this data into sets of entries that share at least one variable. The issue I am running into is if I were to sort by any one variable, it will exclude another one. Say I have it in alphabetical by first name, and there is a John with the same phone number as a Jon. I need the Phone number to be enough to get them in the same set. The issue then is if I sort by phone number, there are a lot of entries that are missing the phone number, but have the same name and won’t be included.

So ideally I would have sets with at least 1 variable the same, and then if it has two variables the same its grouped closer, and so on. Or the ability to sort within these at least one variable sets.

Is this possible in Libre base and any thoughts on how would be helpful.

I am guessing by “variable” you’re referring to a database “field”? I think it might be good if you provided a sample here with some dummy data showing first the dummy input, then the output you would expect. For example, you might have record 1: John, Doe, x@d.com, 123456; record 2: Jane, Doe, j@d.com, 222, … etc for the input. Then from this input what do you want for the output?

I think you can achieve that creating a pivot table for every variable.

Creating pivot table