Finding and Replacing in Tableau
Quick guide to find and replace data in Tableau.
As many of you may know, datasets don’t always contain information in the format you may want. For example, maybe you are presenting a dashboard that has data coming from multiple multilingual sources and you need to change several reoccurring foreign language words into their English counterparts so you can present this dashboard to an English speaking client. Being able to find and replace is a simple way to tidy your data on the fly.
To do this we’re going to be using a “regular expression” as shown in this Tableau example. For this guide I’ll be using a supply chain company dataset available here: https://www.kaggle.com/shashwatwork/dataco-smart-supply-chain-for-big-data-analysis?select=DataCoSupplyChainDataset.csv . I will be replacing “UU. EE.” (a common Spanish abbreviation for the United-States) with “United States”.
The “REGEXP_REPLACE” has three parts to its formula. First you define which field the calculation applies to, then in quotations define what you want to find, and lastly in quotations define the replacement you want to use for it. Click “OK” and use this field in place of your original non-calculated field.
My new calculated field I’ve named “countries” is now displaying “EE. UU.” as “United States”. This method can have many different uses such as fixing typos, mismatches, language corrections and so on. I hope I was able to show you a new technique to use in Tableau to help with your data visualizations. Thanks for reading!