KNOWLEDGE BASE

Inserting Multiple Separators into a String Containing only Numbers


Published: 21 Oct 2016
Last Modified Date: 25 Jul 2017

Question

How to format a string of numbers to display thousand separators in Tableau Desktop. 

Environment

Tableau Desktop

Answer

Use the following regular expression in a calculated field: 
REGEXP_REPLACE([Num],'(\d{1,3}|\G\d{3})(?=(?:\d{3})+(?!\d))','$1.')

Note: Such a workaround will only work for data sources which allow regex functions.

Additional Information

Use the attached sample workbook String example.twbx to view the calculated field in action. 
Did this article resolve the issue?