Choose Language Hide Translation Bar
EMGator
Community Member

Formula issue with long / lat

Reaching out for help to overcome a formula issue. My ultimate aim is to have a bubble chart to track up to 2000 people going in and out of a few cities over time with a background map. Instead of entering long and lat data each time, I’d prefer to type in a city and have long and lat auto populate. I have “city” “long” and “lat” columns (numeric ddd geospatial) and created a formula along the lines of ...if(city=“city name” then = “26*E”. Unfortunately it doesn’t work and the formula changes the numeric geospatial “long” column from numeric to character.

1. Any suggestions on how to fix this error?

2. Suggestions on other ways to achieve an auto populated long lat lost by city?
0 Kudos
2 REPLIES 2
txnelson
Super User

Re: Formula issue with long / lat

The correct formula would be

if(city=“city name” then = 26);

This will result in a displayed value of 26° E

If the value is negative it will display as 26° W

Lattitude values work the same, with positive values being N and negative being S.

Lattitude and Logitude values are stored as numerics in JMP and typically displayed with a format that changes the displayed value, not the actual value.

Jim
dale_lehman
Community Trekker

Re: Formula issue with long / lat

You might try this add-in:  https://community.jmp.com/t5/JMP-Add-Ins/Geocoding-Place-Names/ta-p/22423.  I've had good success with it.