10 Replies Latest reply on Jul 25, 2012 8:21 AM by Weily Shay

# How can I make one Pie Chart per Region on a Filled Map

Hi All-

Can anyone help me figure out how to create just ONE pie chart per region on a US map on top of a filled map? So far, I've been able to make pie charts on top of a filled map, but it always shows one pie chart per state. I'd like to have it so there is only one pie chart per region that shows total sales, profits, and order quantity of that region.

Thank you!

• ###### 1. Re: How can I make one Pie Chart per Region on a Filled Map

Hi,

Not sure that it will be possible using the in built geo-coding. If you have the lat and long values then it is possible. You can take a look at the attachment based on some SA data. I did not have sales etc so did not create a proper pie chart but the principle is the same.

using

• ###### 2. Re: How can I make one Pie Chart per Region on a Filled Map

Hi,

I'm not sure what you mean by having "one pie chart per region that shows total sales, profits, and order quantity of that region." A pie chart shows a part-to-whole relationship, so usually the slices are divided by a dimension or discrete measure, and the three measures you list are all continuous.

There are a couple of ways to set this up. The key is that you need to give Tableau a latitude and longitude, so I imagine you had to put the State in the view since it has those assigned. As Ndabezinhle wrote, if you pick out a latitude and longitude, you can create a file with region, lat, and long and then blend that into the data set to generate your pie charts. That's option 1 in the attached workbook, and is the simplest.

Option 2 uses State to get the geography, and then replaces the measure (SUM([Sales]) in this case), with a table calculation with the Compute Using set to State, and a second INDEX() calc that also has a Compute Using set to State to filter out all but one result per Region. In this case, the point is associated with whatever State is first on the list based on how the dimensions are sorted.

Cheers,

Jonathan

1 of 1 people found this helpful
• ###### 3. Re: How can I make one Pie Chart per Region on a Filled Map

My understanding of what he wants is to have a filled background map at the state level, and then using the dual axis functionality, to have pie charts shown at region level. Hence in the example above, i have a filled map at state (province) level and then what we could turn into a pie chart (didn't have a proper data source) at region level. I could be wrong, but my understanding is that we can only do this by having the lat and long values in the data source.

• ###### 4. Re: How can I make one Pie Chart per Region on a Filled Map

Ndabezinhle,

I could be wrong, but my understanding is that we can only do this by having the lat and long values in the data source.

This isn't exactly true; at least not for the US. Tableau has a Region field predefined in the geo-database for the US, so your data doesn't have to supply the lat/longs for this field. (I'm guessing this isn't true for SA?) Combining your dual-axis with Jonathan's regional pie chart you can get this:

...without having to supply any lat/longs in your data. (See attached.)

--Shawn

EDIT: Note I was completely wrong on this, see entries below.

1 of 1 people found this helpful
• ###### 5. Re: How can I make one Pie Chart per Region on a Filled Map

Hi..thanks for pointing that out. In SA we would need to create the region as we don't have it in our standard geo-code list. Hence the in-built lat long will likely not work for us as our regions are custom created

• ###### 6. Re: How can I make one Pie Chart per Region on a Filled Map

This is exactly what I want!

Could you tell me how to transfer AVG(Latitude) and AVG(Longitude) from one sheet to another? I'm still very new at Tableau so I'm a little lost on how you did this step.

• ###### 7. Re: How can I make one Pie Chart per Region on a Filled Map

Weily,

Actually I totally biffed this one! Ndabezinhle is right, you do need to provide the lat/long for the region field, which Jonathan did using a clipboard connection. Sorry Jonathan, I totally missed that! So to make amends I'll provide a step-by-step set of instructions of how to create the map from scratch. Give me a couple of minutes.

--Shawn

• ###### 8. Re: How can I make one Pie Chart per Region on a Filled Map

Weily, here you go...

Hope this helps. (Workbook attached.)

--Shawn

• ###### 9. Re: How can I make one Pie Chart per Region on a Filled Map

Excellent instructions, thanks, Shawn!

• ###### 10. Re: How can I make one Pie Chart per Region on a Filled Map

Thank you so much! This was really helpful!