Select to view content in your preferred language

field calculator

5384
23
06-15-2015 02:16 PM
AndrewWindham
Deactivated User

I am using ArcGIS 10.3 basic desktop to interpolate GPS soil points and then create a lime prescription map. I can easily interpolate the points however when I use the field calculator to enter the target lime formula for the desired pHw level I get an error message of 99999 that says a field name was not found or there were unbalanced quotation marks. The formula was produced by a leading university and has been used in numerous types of software so I don't believe it is the problem.

Thanks

Tags (1)
0 Kudos
23 Replies
AndrewWindham
Deactivated User

I have already calculated the value of the field, now I need to apply the formula to the interpolated points in the attribute table that will raise the soil ph level to 6.3. I have the formula but it will not work in field calculator I guess because it is not a python or vb code. The code is intended to target areas that have a ph level below 6.3 and bring them to that level. The formula is below.

phw[0,6.24] : ((6.5-(-0.6))2*1.5)

phw[6.24,max] : 0

Thanks

0 Kudos
SepheFox
Deactivated User

Assuming you want to replace the value of the PHw field with new values, your field calculator should look like this:

Parser:
VB Script

Expression:
phw

Code Block:
Dim phw
If [phw field] > 0 and [phw_field] < 6.24
phw = (((6.5-(-0.6))2*1.5))

else [phw field] > 6.24
phw = 0

end if

DarrenWiens2
MVP Honored Contributor

From the beginning, this equation has been missing an operator before the 2 in: (((6.5-(-0.6))2*1.5))

SepheFox
Deactivated User

Good point. In a math equation, isn't that just seen as multiplication, as in (7.1)3 = 21.9? What I don't understand, is this equation is just a number isn't it? Why use a complicated expression, for what appears to simply be, if phw < 6.4, result = 21.9. Obviously we are missing something.

0 Kudos
DanPatterson_Retired
MVP Emeritus

soil pH measured in water? (it has been a long time)

phw[0,6.24] : ((6.5-(-0.6))2*1.5) =  (7.1)*2**1.5) = 14**1.5 ????

really?  something is missing in the formula since the actual value of pH isn't a variable anywhere. Can you go to the original reference and put the formula in without any substitution of terms. Or at least provide a reference (ie USDA, Brady et al or any soils text)

AndrewWindham
Deactivated User

Try this one

phw[0,6.24] : ((6.5-(-0.6))2*1.5)

phw[6.24,max] : 0

0 Kudos
DanPatterson_Retired
MVP Emeritus

the image isnt coming through on the iThingy and what you typed is not a formula, since there are no variables

right now, you take 6.5...subtract -0.6 from it...I presume multiply by 2 raised to the power of 2... that is a number.  Just copy and paste that number down the column and you are done. or ... write out the formula that shows where the variables are...I am wildly guessing that it is in the -0.6 term but you have the source

0 Kudos
SepheFox
Deactivated User

Isn't that the same? I don't see the difference.

0 Kudos
DarrenWiens2
MVP Honored Contributor

Since these are all constants, not variables from your table, you may as well just type in the number. Also, you do not have enough mathematical operators in the first part of the equation.

(6.5 minus -0.6) ______ 2 times 0.5

0 Kudos
DanPatterson_Retired
MVP Emeritus

I think this may a job for ArcObjects