I have a Feature Class with 3.2 million records which represents customers. Each customer is assigned to a particular store ID (DID)
So I'm trying to split the customer record into store ID datasets. That is, for each store ID (DID), create a dataset of the customers assigned to it, essentially splitting the FC by each unique attribute in the field.
I was able to pull up a list of the unique store IDs by using:
which resulted in a list of all of my unique store IDs, 957 in all.
What I'm not sure of however, is how to go about iterating through that list and using each value in the list in a where_clause in a "FeatureClassToFeatureClass_conversion" to export each unique dataset.
I know there are third party developed tools to do this, but they don't seem to work due to the number of records. I've tried every single one I could find.
So I'm trying to split the customer record into store ID datasets. That is, for each store ID (DID), create a dataset of the customers assigned to it, essentially splitting the FC by each unique attribute in the field.
I was able to pull up a list of the unique store IDs by using:
Code:
def Unique_Values(table, field):
with arcpy.da.SearchCursor(table, [field]) as cursor:
return sorted({row[0] for row in cursor})
fc = "C:\Users\username\Documents\ArcGIS\Default.gdb\MyCustomers"
field = "DID"
UniqueValues (fc, field)What I'm not sure of however, is how to go about iterating through that list and using each value in the list in a where_clause in a "FeatureClassToFeatureClass_conversion" to export each unique dataset.
I know there are third party developed tools to do this, but they don't seem to work due to the number of records. I've tried every single one I could find.