Select to view content in your preferred language

How would I calculate the percentage of a specific field (Asian) in an attribute table?

952
1
01-20-2018 08:30 PM
__17
by
Emerging Contributor

When I type in (Asian/Total14popu) in the field calculator, I get results mostly being 0%,which is impossible. Am I calculating this correctly? I think not because I've been getting mostly 0% for my results except for some rows in the new field where I am calculating this from.

0 Kudos
1 Reply
DanPatterson_Retired
MVP Emeritus

Python parser for the field calculator.  ! ! around the field names

!Field1!/float(!Field2!) * 100.

You want to make sure you aren't doing integer division, hence convert one of the two fields (which are probably long/short integer) to floating point numbers.  And if you want percentage, convert the ratio to a percentage by multiplying by 100