7 Replies Latest reply on Oct 18, 2018 1:17 PM by Ken Flerlage

# Can we create Predominance Charts in Tableau?

Essentially, I want a filled map that colors in the top facility (out of 3-5) by volume for each zip code, with shading determined by the difference between #1 and #2.

I make these in Esri ARCGIS fairly regularly, but would love to be able to incorporate it in Tableau.  I currently use Tableau 10.4.7 (32-bit)

• ###### 1. Re: Can we create Predominance Charts in Tableau?

The most difficult part of this are the calculations to choose the top 2 facilities, then do the math to calculate the difference. How to do that would be heavily dependent on the structure of your data. Are you able to share a sample of your data so we could take a closer look?

• ###### 2. Re: Can we create Predominance Charts in Tableau?

The true data is proprietary, but here is some mock excel for it.

• ###### 3. Re: Can we create Predominance Charts in Tableau?

I put together a sample data set, which I've attached. Again, the tricky part is the calculations to find the top 2 facilities. This required a bunch of different calculated fields. I won't detail each field, but the basic logic is as follows:

1) Calculate the volume for each zip code and facility.

2) For each zip code, find the maximum volume.

3) Next find the second maximum volume.

4) Perform the math the find the difference between 2 and 3.

5) By comparing each facility's volume, find which facility is our top facility and which is our second.

6) Create bins on the difference so that we have a discrete field we can pair with the top facility discrete field, in order to create separate color shades.

After doing this, we can build the map and color it based on both the top facility and the difference. If you drag these field to the color card at the same time, Tableau will guess that you want to have separate colors for each top facility with a continuous palette within each one. They are still discrete color palettes, so if you want to change a color, you'd have to manually select the different shades.

See attached.

• ###### 4. Re: Can we create Predominance Charts in Tableau?

Haha! Those may be the best company names I've ever seen!!

The sample I ended up creating looks very similar to this, so my approach should work. It's not a particularly elegant solution, but it works.

• ###### 5. Re: Can we create Predominance Charts in Tableau?

Thanks very much.  I'll definitely copy this method in the future.

Would anything change if there was a field for Product Lines. For example, if I had zip code counts broken down for the companies by {Apple, Banana, Orange}, would there need to be anything added into the calculation?  I am a complete novice at LOD expressions.

• ###### 6. Re: Can we create Predominance Charts in Tableau?

I think that the Facility 1 Volume Match and Facility 2 Volume Match formulas would require some modification as they are not aggregating Volume in the IF statement. You'd want to aggregate there if you had multiple records for each facility. But, I think if you would just replace Volume with Zip Facility Volume then that would take care of the problem.

LODs can be a bit tricky at first, but they're very powerful (and kinda fun) once you figure them out.

• ###### 7. Re: Can we create Predominance Charts in Tableau?

BTW. This is a really cool use case and I've never seen this done before, so I'm probably going to write a short blog on how to do it in Tableau. I'll be sure to mention you.