I’ve put together a really simple Geochart that ‘should’ render a count of Accounts based on BillingCountry and BillingState. No buckets and only default styling used.
The ‘series’ is using the Count function on the Id field, and BillingState and BillingCountry are both in the model. I’ve also tried using BillingCountryCode and BillingStateCode picklist fields instead, but no luck.
I feel like there’s something really simple that I’ve missed, but can’t seem to figure it out. I’ve copied the page xml below - if anyone has any tips I’d greatly appreciate it.
Well this is odd - mine are both full text for country/state code (the picklist data type) and for BillingCountry/BillingState fields (string data type).
I do have state & country picklists enabled so that might affect things. I had thought the BillingCountryCode (picklist field) would bring up the 2-letter country code (which is coming up as ‘US’ in my state & country settings).
I’m using the 2 char strings for it to work. Seems to only work with 2 char strings. Those code fields. Are they custom fields? I don’t remember seeing them.
ah ha! that would be the reason. I created a custom text formula field on the Account model which just contains “US”, and now its rendering (all accounts based in the US) - so it must be operating on the 2-letter country code.
However, the 2-letter code doesn’t appear to be available to my model - I would think it has something to do with state & country picklists - have you got them enabled or not?
We need documentation :). This very well may be a backlog item. If so, your suggestion seems to be a fine interim solution for using country/state/province picklists. Just gotta luv dem formula fields!
Hi, guys. Thanks for helping us kick the tires a bit on GeoCharts. We’re excited to see how you use it! It looks like you already found the tie in to State and Country Picklists. The maps we deliver are made to play nicely with your data if you use this Salesforce feature, but as you noticed, you did uncover a bug (and a workaround!). I’ve already got it patched up in our Dev Org, and it should go out with our next patch release. We are also continuing to beef up our documentation, so look for updates to that in the near future.
Just to save anyone who may stumble across this thread some time catching up, the country and state values used by the maps we deliver correspond to two character ISO codes. If your org has full country names or some other abbreviations (e.g. “U.S.A.”), you’ll need to convert the data or use formula fields to translate it. Creating one off formula fields is a quick way to get results, but of course, that only works one object at a time, and isn’t the most scalable solution. Salesforce also prevents grouping on Formula Fields in aggregate queries. The aforementioned Salesforce State and Country Picklists feature can help too, but be warned, it is a process that takes time to implement and you can’t go back once you enable it, so be sure to read up on it and try it out in a testing environment first.
The county maps all use three digit FIPS codes (http://www.census.gov/geo/reference/codes/cou.html). So for Hamilton County, TN, the country code would be US, the state code would be TN, and the county code would be 065.