KNOWLEDGE BASE

Inserting Multiple Separators into a String Containing only Numbers


Published: 21 Oct 2016
Last Modified Date: 17 Jan 2019

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.

Discuss this article... Feedback Forum
Did this article resolve the issue?