Select to view content in your preferred language

Set field datatypes when using Excel file

1068
1
01-08-2024 08:57 PM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 3.2.1

I have an Excel .XLSX spreadsheet that I want to use in ArcGIS Pro:

Bud_0-1704775200213.png

When I navigate to the spreadsheet in Catalog and open the Fields view, I see that ArcGIS Pro has guessed at the datatypes.

Bud_1-1704775478524.png

Those datatypes aren't quite right. The integer fields have been interpreted as doubles. 

I want to change the interpreted datatypes from double to integer for clean data analysis and join purposes. But if I understand correctly, that doesn't seem to be possible without doing something like the following:

  1. Import the table to a geodatabase
  2. Rename the fields to ..._OLD
  3. Create new fields with the correct datatype
  4. Populate new fields via a field calculation
  5. Delete the ..._OLD fields.

That's not ideal.

  • Too much effort.
  • Now I'm using a copy of the data instead of the refreshable Excel data.

It's my guess that the Excel data has been copied into memory or into an FGDB somewhere (that's why we're able to do things like use SQLite SQL on Excel files). If that's the case, could we have the option of setting/overriding the field datatypes? Maybe it would be as simple as making the Fields View editable instead of read-only.

1 Comment
MarkGo
by

It's even worse when you have a field that has mostly numeric values, but also has text catch-alls.
I have a dataset that has counts through 12, then a "> 12" value and "N/A". 
Arc Pro interpreted that as a double, because most of the values were numeric, but left me without data for the >12 and N/A rows. 

You can right click on an Excel sheet in catalog and bring up Data Design -> Fields, but it's "read-only". This is the perfect place to set your preferred field type, which you could do prior to importing the datasheet. 

Calling that "read-only" is nonsense, since it was arbitrary assumption by the software, not something that is coded into the Excel sheet. There is absolutely no reason why I shouldn't be able to override the assumed field type.

MarkGo_0-1761924699324.png