KNOWLEDGE BASE

How to Get The Number of Fields Divided When A Field Is SPLIT by A Specific String


Published: 12 May 2022
Last Modified Date: 08 Jul 2022

Question

How to get the number of fields divided when a field is SPLIT by a specific string in Tableau Prep Builder.

Example:

When a value "A:B:C" is split by ":", 3 (A,B,C) is obtained.

 

Environment

  • Tableau Prep Builder 2021.4.3
  • Windows10
  • Tableau Data Engine

Answer


Create a calculated field.
LEN([target field]) - LEN(REPLACE([target field], ":" , "" )) + 1

User-added image
Did this article resolve the issue?