I have run into a problem that I have spent way too long trying to solve.
I am trying to display the number of suppliers that cover a certain postal code as a bar chart.
Postal code as the dimension
and COUNTD(SupplierID) as the measure.
The issue is this:
In our database, the postal codes are stored like this:
The covered postal codes are all comma separated in the same string.
WHAT I NEED IS THIS:
I need a new dimension (probably a calculated field of some description) with the values:
I want it to display the values that include "UK-AB", "UK-AL" etc.. I am expecting duplicate SupplierIDs across the postal codes.
I have tried using Calculated fields like
IF CONTAINS([Locality],"UK-AB") = TRUE THEN "UK-AB"
ELSEIF CONTAINS([Locality],"UK-AL") = TRUE THEN "UK-AL"
But this always returns the first value it hits.
Any suggestions? :-)
You can't create a calculated field for this in Tableau, you need to pre-process the data so it's split when you bring it into Tableau.
You could use custom SQL to do this in Tableau, but it would depend on the type of datasource you're connecting to.
Become a Viz Whiz on the Forums!
Support the Community and master Tableau.
Retrieving data ...