BAQ Calc Field to remove line breaks

Is there a way that I can use a calculated field in a BAQ to remove the line breaks, so that I just have one very long line instead of multiple lines? I am building a dashboard to show a collection of Change Logs. Many change logs have line breaks in them and so don’t visually render the additional lines in the dashboard.

I’ve seen other threads like this that explain a different way to do what I am trying to accomplish, but I would much prefer a calculated field that removes line breaks for our use case. Is that possible?

1 Like

Yes. The line breaks are characters and you can find those characters and remove them or reformat them so you can see the info better. I have some code I can share when I get back to my office if no one else has anything before then.

3 Likes

Yes! You have to replace the linebreaks in your fields. The replace function usually works well for this. The characters you want to replace are char(10) and char(13). Replace them with a space or a pipe or something unique if you want to know where the linebreaks were.

2 Likes

I should have asked ChatGPT first. It wrote the code for exactly what I needed!

REPLACE(REPLACE(ChgLog.LogText, CHAR(13), ‘’), CHAR(10), ‘’)

Mind blowing that it can do this so well!

You really shouldn’t have.

These two idgits are much funnier.

1 Like

back in the olden days, you could replace with a CHR(7), and a bell would ring every time the data was displayed (yes… that was a thing!). Chr(7) is the ascii character called “BEL”… back in the olden days, it was a “funny prank” to play on your teacher, to insert several of these invisible BEL symbols into your code to make more noise. https://www.asciitable.com/

3 Likes

Haha, that is awesome Tim! Thx for sharing.