1

I have a table, coming from Excel, with 21K rows, which is partially filled with numbers, and partially with the "" value from excel, which is displayed as <Null> in the table view.

I need to use the number values to display as graduated colors, which ArgMap won't allow me, as they are stored in a string column.

I tried converting those values into Double()'s using the field calculator as is mentioned in this article from ESRI: https://support.esri.com/en/technical-article/000002287

The code I used from the article is:

Dim String, Check
String = [String field name]
Check = IsNumeric(String)
If Check = True then
Output = CDbl(String)
else
Output = null
End if

And wrote Output in the second field.

Where I clicked on the appropriate field name to insert the name behind String.

This however produces a column full of <NULL> values, without any error message.

  • What format is your data in now / how did you import the table from Excel? Can you add the code you used in Field Calculator? – BERA Mar 6 at 13:10
  • I just clicked the add data button, and selected my excel file. It is of Type: String, and uses a , as decimal seperator. – Luuklag Mar 6 at 13:15
  • Then you are trying to edit the excel file from ArcMap. I dont Think you should do that. After you add the table, right click it and export to a file geodatabase. Then try your code on the exported table. What is your next step after you manage to calculate the field? – BERA Mar 6 at 13:18
  • 1
    Yep, this did the trick. Perhaps you want to add that as an answer @BERA – Luuklag Mar 6 at 13:24
2

If you just added the excel file to the map, you are trying to edit it using ArcMap which you should avoid.

Right-click the added table and export to a file geodatabase and try your code again on the file geodatabase table.

(btw you should try and learn python instead of vb in Field Calculator, vb is going away)

| improve this answer | |
  • 1
    I'm also used to program in VBA, so vb is really close to that. Shame to see it go :( – Luuklag Mar 6 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.