Dynamic Change of Strings (Upper to Lower Case and Vice Versa)
Updated: Aug 18, 2021
Is there a way of changing text strings in Tableau from uppercase to lowercase and vice versa? This article will help you explore a way around this, and it is by using parameters with calculated fields.
Using data on Complaints filed against the public institutions in Kenya. We’ll create a Word Cloud to visualize the nature of complaints, and with the help of a parameter and a calculated field make our viz dynamic in selecting either uppercase or lowercase strings.
Creating a Word Cloud
Once connected to data set shared in the link above;
Drag dimension field ‘Nature of Complaint’ to the ‘Text’ shelf.
Choose ‘Text’ under marks card.
Drag measure field ‘Number of Records’ or 'Complains (Count)' to the ‘Size’ shelf.
Drag dimension field ‘Nature of Complaint’ to the ‘color’ shelf and hide the legend.
Note: This viz is static and doesn’t allow the user to toggle from uppercase to lowercase and vice versa.
Let’s Make the Viz Dynamic
Create a parameter first
Important: Learn how to create a parameter in Tableau.
Create calculated fields to define how texts will be treated.
Link the parameter with the two calculated fields above, using the formula below.
Now, lets make the viz dynamic
Repeat the steps of creating a word cloud, but now using the calculated field we’ve created ‘Complaints’ instead of ‘Nature of Complaints’.
Note: This creates a dynamic viz which updates when the parameter changes.
I hope this article was helpful to you. To receive more of the Tableau tips and tricks, kindly join our mailing list by subscribing below.
Thank you for reading.