Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
bdroesch
Contributor
Contributor

Chr(10) and Chr(13) doesn't work in Table but does in Text Box

Hi,

I would like to have a column in a table that will contain a list of notes for that row. The notes will indicate if certain thresholds have been met for that row. There are 13 thresholds in total (this may increase over time). For each note, I would want it to appear on a new line. So below would be an example of 1 cell in the table which shows that three of the 13 thresholds were breached.

Threshold A Breached

Threshold B Breached

Threshold D Breached

 

I know that I could write a long nested if statement that would output this list for me but I felt it would be best practice to create one String field in my data model that would contain the concatenation of the 13 Threshold Strings. I want this field to print a new line so I started to test whether this was possible. Below is an example of me creating a concatenation of two Test Strings using Chr(13) and Chr(10).

,[Threshold String1] & chr(13) & [Threshold String2] as Test_String
,[Threshold String1] & chr(10) & [Threshold String2] as Test_String2

When I add Test_Sting & Test_String2 to Text Boxes, new lines appear for Threshold String2.  But when I add them as Measures or Dimensions to a table it doesn't work. Instead, Threshold String 1 & Threshold String2 are just lumped together. Can someone please tell me why this works in the text box but not a table? 

Thank you,

Brian

7 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Here is my understanding of the issue.  The chart is rendered using HTML.  CRLF (chr(13) & chr(10)) characters are ignored by HTML.  Unless the visualization author intentionally translates CRLF into an HTML tag (like <br>) that renders as a line break, you will not see the newline.  So it appears the authors of the text object chose to do the translation, the table authors did not.  

Perhaps someone knows of a workaround.

-Rob

mikaelsc
Specialist
Specialist

make it horizontal again, and using what is described here Creating Mini Charts

could make it even cooler 🙂 

 

 

bdroesch
Contributor
Contributor
Author

Can you elaborate a little more? I am confused as that link is referencing Mini Charts.

mikaelsc
Specialist
Specialist

instead of creating 

Treshold 1

Treshold 2

Treshold ... 

(for only one row)

as you initially wanted, you could create a similar expression that generates a (eventually with a trailing space) to represent the same: 

█ █ █ █ █

█ █ █ █ 

█ █ █ █ █ █ █ █ █ 

(one line per row) 

 

bdroesch
Contributor
Contributor
Author

But I want to output text for each threshold For example, let's say Threshold A represents Sales and Threshold B represents Losses. My output may look like something below:

Sales Dropped More Than 20%

Losses Increased More Than 10%

mikaelsc
Specialist
Specialist

ow like that....

well... find/define 13 symbols that will represent those tresholds 🙂 https://unicode-table.com/en/ 

sales up: 8593

sales up a lot: 8648

 

... sorry... can't do better

bdroesch
Contributor
Contributor
Author

From what I can tell I am able to use the CHR() function in a measure in a table for other symbols.  For example, I have been able to add different type of bullets which are helpful to delineate between different text.  But chr(10) & chr(13) do not create new lines in the cell for my table.