Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Inserting Line Breaks in Column Styling in Table Using a Formula

JW1115
5 - Atom

I have a text field that I would like to insert line breaks into based on a date value as shown below:

 

3/15/18 No change4/16/18 No change5/15/18 No change6/14/18 EAC still within 120% threshold.7/17/18 No change8/16/18 Same as last month9/20/18 No Change10/12/18 Same as last month 11/12/18 No change12/17/18 Same as last month1/15/19 Same as last month2/18/19 Same as last month3/15/19 Same as last month 4/11/19 Same as last month5/17/19 same as last month6/17/19 same as last month7/18/119 Same as last month8/16/19 Same as last month.9/19/19 Same as last month.10/18/19 Same as last month.11/19/19 Same as last month.12/18/19 EAC still within 120% threshold.1/16/20 Same as last month.

 

I would like the text to appear as such:

 

3/15/18 No change

4/16/18 No change

5/15/18 No change

6/14/18 EAC still within 120% threshold.

7/17/18 No change

8/16/18 Same as last month

9/20/18 No Change

10/12/18 Same as last month

11/12/18 No change

12/17/18 Same as last month

 

This formatting exists in the input for my workflow but is lost as the data is processed. I am not sure what function could be used to accomplish this but I would appreciate any ideas that others might have. Thanks in advance.

6 REPLIES 6
CharlieS
17 - Castor
17 - Castor

Hi @JW1115 

 

Here's an example to get your started. It works, but I'm hoping someone has an alternative that can RegEx the dates and message in one expression.

 

- I start out by using RegEx to match the date strings using the following expression: \d{1,2}\/\d{1,2}\/\d{2}

- These dates are then used to replace those values in the original with a "|" character so the descriptions can be split too.

- Once the dates and message values are all split, I Join those values and combine them in a Formula tool.

- These [Date]+[Message] strings are then concatenate with a newline character "\n" in a Summarize tool.

 

This is now a text field with all the values on new lines. Check out the attached workflow to see this in action. 

 

PS: There's one date value in your example that threw me off. "7/18/119" has too many year digits. 

DavidP
17 - Castor
17 - Castor

How about something like this?

 

DavidP_0-1583273735301.png

 

JW1115
5 - Atom

These are both great solutions but I think I may have poorly communicated the solution I needed.  I am trying to do this formatting in one cell and use each occurrence of the date as the start of the next return within that cell.  I have a feeling this complicates this solution a bit more. 

 

Here is an example of what the original cell looked like:

 


1/17/17 No change.  Same as last month.
2/24/17 No change
3/21/17 No change
5/16/17 No change
6/13/17 No change
7/18/17 No change
8/17/17 No change
9/19/17 No change
10/13/17 No change.
11/15/17 No change.
12/18/17 No change.
1/19/18 No change.
2/16/18 No change
3/19/18 Reimbursement was made upfront. 
3/19/18 Reimbursement was made upfront. 
6/14/18 Payment made upfront.
7/17/18 No change
8/16/18 Same as last month
9/20/18 Same as last month
10/12/18 Same as last month
11/16/18 No change                                                                                            
12/17/18 Same as last month
1/15/19 Same as last month
3/15/19 Reimbursement was made upfront.
4/11/19 Same as last month  
5/17/19 Same as last month
6/17/19 Same as last month
7/18/19 Same as last month
8/16/19 Same as last month.
9/16/19 Same as last month
10/18/19 Same as last month
11/19/19 Same as last month.
12/18/19 Same as last month.
1/16/20 Reimbursement was made upfront.

 

 

Thanks for your help on this.  Maybe there is a way to keep this format on the front end of the workflow and I am overthinking it?

DavidP
17 - Castor
17 - Castor

Is this what you're looking for?

 

DavidP_0-1583450000192.png

 

cpapaioannou
7 - Meteor

@DavidP  Just a follow-up question a year later... The solution is perfect but I am struggling outputting it to excel. It seems as though - at first - excel concats all the embedded newlines. However if you double-click and hit enter, it seems fine.

cpapaioannou_0-1617361359981.png

 

Is it an excel issue? Is there any easy fix?

 

Thank you!

cpapaioannou
7 - Meteor

Nevermind, there was an easy fix just by enabling the excel's 'wrap text' cell functionality. 

Labels