Sep 12, 2007 The Cuzick–Tyrer model was the most consistently accurate model for prediction of breast cancer. The Gail, Claus and BRCAPRO models all significantly underestimated risk, although with a manual approach the accuracy of Claus tables may be improved by making adjustments for other risk factors ('manual method') by subtracting from the lifetime. Air Pressure at Altitude Calculator. These equations help to model this through the use of the temperature lapse rate, which is the rate at which temperature changes through altitude change. Some layers, such as the stratosphere (from 11km to 20km), have a constant temperature throughout the layer.
I am using ArcGIS 10.2 for Desktop, and I've been looking through this site, and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with ArcGIS. I know I can do this the slow way with Select By Attributes, but It's time consuming.
I am attempting a spatial join between cases of a disease (points layer) and US Census Tracts (polygon layer). This requires count data. For each point/case, I have a field called YEAR with date ranges 2001 to 2012 depending on what year the case happened. I need a count column for each year. For example, the first one I'm calling COUNT01. If the case date in YEAR is 2001, then COUNT01 will have a 1 in it. If it is any other year (2002-2012), then there will need to be a 0. I will have COUNT02, COUNT03...COUNT12 columns. Can't have a 'Null' value.
Here's what I've tried so far
And here is what the data looks like in Arc.
PolyGeo♦54.4k17 gold badges84 silver badges253 bronze badges
BenWBenW
3 Answers
I think this is what you want .... using python you could do the following (assumes YEAR and COUNT0X fields are integers)
- Change to Python as highlighted below
- Add the code to the 'Pre Logic' input box
- Change the yearVal as needed for each field youcalculate (Count01 would use 2001, Count02 would use 2002, etc)
Note Python using indentation to parse the code so ensure the spacing is correct.
dark faderdark fader
This answer is essentially the same as listed above, however it's a way to not have to use the code block... for the Count01 field, you would set the parser to Python and then set your calculation to
The way this reads is: Set the field to 1 if the YEAR field is 2001, if it's not 2001, then set it to 0...
If you have multiple if conditions, you can nest the 2nd (and subsequent) 'if' conditions inside the else statement, such as this...
The way this reads is: Set the field to 1 if the YEAR field is 2001, if it's not 2001, then set it to 2 if it's 2002, if not, then set it to 0...
Jason MillerJason Miller1,0561 gold badge9 silver badges20 bronze badges
If you are going to use VBScript then your field calculation was set up wrong. Firstly I would not use a variable which is the name of the field, this is confusing, use a different name so its crystal clear what you were setting. Your 'endif' was wrong it should be 'end if' and your code should have been in the pre-logic script section. The correct way of setting this up is shown below. But as the others have said, try not to use VBScript as ESRI are hell bent on getting rid of it in favour of Python.
HornbyddHornbydd27.6k3 gold badges29 silver badges58 bronze badges