Image Roles in Tableau

Vignesh Suresh
5 min readApr 21, 2023

Image Roles: An Introduction

Image Roles were introduced in Tableau 2022.4, which allows users to use web images through Image URLs. One may ask, why introduce a new feature if we can achieve the same results with default shapes? Let’s explore the differences between Image Roles and Default Shapes.

Image Roles and Default Shapes: A Comparison

Image Roles offer the option to use custom images, which can be useful when you have specific images or icons that you want to use. Image Roles also allow for dynamic images, where the image changes based on the data value. For example, you can use different flag images to represent different countries in a dataset. Moreover, Image Roles maintain a consistent size and shape for all images.

Default shapes, on the other hand, provide a simpler and more streamlined way to represent flags in Tableau. This option is particularly useful when you don’t have specific images that you want to use, or if you want a consistent look and feel throughout your visualization. Default shapes come pre-packaged with Tableau, making them easy to use and access. However, if the downloaded images are of different sizes, they may need to be replaced with images of the desired size.

Ultimately, the choice between Image Roles and Default Shapes depends on your specific needs and preferences. If you have specific images that you want to use or want to create a more dynamic visualization, Image Roles may be the better choice. However, if you prefer a simpler and more consistent approach, Default Shapes may be more suitable.

In this tutorial, we will explore how to use Image Roles in Tableau while maintaining the file by adding new data to the existing dataset.

To accomplish this, we need a Master file and a Main file. The Main file should have columns named FlagCode (which acts as a unique identifier for joining), Flag, URL, and Wins. To join these columns, we need a Master dataset that includes FlagCode and Flag.

To get started, open Tableau and perform a Left Join on the FlagCode column. Next, right-click on the Image field and select Image Role > URL. This step should be performed for the URL fields, as the Image Role is a URL field.

Drag Image to Rows. If the URL is correct, you will see Flag Images. Add Wins to the Columns shelf and Flags to the Rows shelf. The view should resemble the image shown below.

We can now add new data to the file, specifically for Kenya and Canada. To do this, we need to update both the Master and Main files.

Refresh the data source, and you should see the updated countries with their corresponding wins.

Thank you for reading. Connect with me on Twitter and LinkedIn, and check out my Tableau Public profile for more visualizations.

Image Roles and Default Shapes: A Comparison

Image Roles offer the option to use custom images, which can be useful when you have specific images or icons that you want to use. Image Roles also allow for dynamic images, where the image changes based on the data value. For example, you can use different flag images to represent different countries in a dataset. Moreover, Image Roles maintain a consistent size and shape for all images.

Default shapes, on the other hand, provide a simpler and more streamlined way to represent flags in Tableau. This option is particularly useful when you don’t have specific images that you want to use, or if you want a consistent look and feel throughout your visualization. Default shapes come pre-packaged with Tableau, making them easy to use and access. However, if the downloaded images are of different sizes, they may need to be replaced with images of the desired size.

Ultimately, the choice between Image Roles and Default Shapes depends on your specific needs and preferences. If you have specific images that you want to use or want to create a more dynamic visualization, Image Roles may be the better choice. However, if you prefer a simpler and more consistent approach, Default Shapes may be more suitable.

In this tutorial, we will explore how to use Image Roles in Tableau while maintaining the file by adding new data to the existing dataset.

To accomplish this, we need a Master file and a Main file. The Main file should have columns named FlagCode (which acts as a unique identifier for joining), Flag, URL, and Wins. To join these columns, we need a Master dataset that includes FlagCode and Flag.

Main File
Master File

To get started, open Tableau and perform a Left Join on the FlagCode column.

Next, right-click on the Image field and select Image Role > URL. This step should be performed for the URL fields, as the Image Role is a URL field.

Drag Image to Rows. If the URL is correct, you will see Flag Images.

Add Wins to the Columns shelf and Flags to the Rows shelf. The view should resemble the image shown below.

We can now add new data to the file, specifically for Kenya and Canada. To do this, we need to update both the Master and Main files.

Updated Main File
Updated Master File

Refresh the data source, and you should see the updated countries with their corresponding wins.

Thank you for reading. Connect with me on Twitter and LinkedIn, and check out my Tableau Public profile for more visualizations.

Vignesh Suresh

--

--