Jump to content
  • 0

How to remove duplicate characters from a string


CoopperBackpack

Question

3 answers to this question

Recommended Posts

  • 0

 Just sharing the solution in the Question&Answer way. Maybe it is helpful for some forum members.

This formula helped to remove extra commas from the string:

REPLACE(LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(([@field:field_1] + ',' + [@field:field_2] + ',' + [@field:field_3] + ',' + [@field:field_4] + ',' + [@field:field_5]), ',', '><'), '<>', ''), '><', ','), ',', ' '))), ' ', ',')

The output is the following (Formula_1 field):

JLMcbG4.png

 

Link to comment
Share on other sites

  • 0

Thank you for sharing this @CoopperBackpack!

I have been trying to utilize this formula on the DataPage as well, however seems that there are some limitations and it works in the Table formula only. 

Here is alternative SQL formula that I have found. It can be used in a Calculated field/value on the DataPage:

COALESCE( NULLIF([@field:A],''), '') + COALESCE(', ' + NULLIF([@field:B],''), '') + COALESCE(', ' + NULLIF([@field:C] ,''), '') + COALESCE(', ' + NULLIF([@field:D],''), '')
image.png


Regards

Link to comment
Share on other sites

  • 0

Just an update.

If there are blank values and the output should be a concatenated string with line breaks, it works with the following formula:

COALESCE(NULLIF([@field:A],'')+char(13), '') + COALESCE(NULLIF([@field:B],'')+char(13), '') + COALESCE(NULLIF([@field:C],'')+char(13), '') + COALESCE(NULLIF([@field:D],''), '')

m5Zuvap.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...