Articles in this section
Category / Section

How to Split string using Expression in Bold BI?

Published:

Split expressions are useful when you want to separate parts of a string in a column. While PostgreSQL has built-in split functions, you can also achieve this in SQL Server connections using the PARSENAME and REPLACE functions.

Splitting Expressions in SQL Server Connections

To split expressions in SQL Server connections, you can use the following expression:

PARSENAME(REPLACE([Column Name], ' ', '.'), 2)

To split expressions in PostgreSQL connections, you can use the following expression:

SPLIT_PART([Column Name],' ',1)

Replace [Column Name] with the name of the column you want to split.

Example

Suppose you have a column called FullName with values like “John Doe” and you want to split the first part of the name (the first name) from the full name. You can use the following expression:

For SQL Server
PARSENAME(REPLACE([FullName], ' ', '.'), 2)
For PostgreSQL Server
SPLIT_PART([FullName],' ',1)

This expression will replace the space between the first and last name with a period and then use the PARSENAME function to extract the first part of the name. The above expression will return the first name “John”.

Related Links

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SM
Written by Siranjeevi Murugan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied