KNOWLEDGE BASE

Inserting Multiple Separators into a String Containing only Numbers


Published: 21 Oct 2016
Last modified date: 20 Jul 2023

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?