CoopperBackpack Posted March 24, 2021 Report Share Posted March 24, 2021 Hi, I have several fields in the table with the Text(255) data type and need to concatenate these values in the Formula field as comma-separated values. The formula is simple as looks like this: The issue is that in some records some vales are blank an the output has extra commas: How to remove them? Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted March 24, 2021 Author Report Share Posted March 24, 2021 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): sandy159 1 Quote Link to comment Share on other sites More sharing options...
0 sandy159 Posted April 1, 2021 Report Share Posted April 1, 2021 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],''), '') Regards Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted October 20, 2021 Author Report Share Posted October 20, 2021 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],''), '') Quote Link to comment Share on other sites More sharing options...
Question
CoopperBackpack
Hi,
I have several fields in the table with the Text(255) data type and need to concatenate these values in the Formula field as comma-separated values.
The formula is simple as looks like this:
The issue is that in some records some vales are blank an the output has extra commas:
How to remove them?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
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.