Alteryx Designer Desktop Discussions

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

Can the headers in the Table Tool be split into two lines?

Newt
8 - Asteroid

I have column names that are long, and the table would look better if the column headers could be splits into two lines.

 

For example, "NonHispanic H.S. Dropouts" would be better as

 

 NonHispanic

H.S. Dropouts

 

and more columns could fit in the table.

 

Is this possible?

 

Thanks.

 

8 REPLIES 8
danilang
19 - Altair
19 - Altair

Hi @Newt 

 

Can some provide some more examples as well as the rules as to how you'd like the strings to be split?

 

Dan

Newt
8 - Asteroid

Hi Dan,

I'd like to be able to do in Alteryx what one can do in Excel.  There, you can split text to two or more lines by inserting an Alt/Enter and it breaks the text at that point.  

This would be faster than figuring out some sort of rule-based split.

But is either possible to split column headers at some pre-determined spot?  I know that making the width smaller will force the headers into two lines, but the split is not consistent.  For example, I'd want

 

Hispanic

H.S. Dropouts

 

and

 

Asian

H.S. Dropouts

 

and not

 

Asian H.S.

Dropouts

 

that results from just making the column narrower.  I want to make the type of info on each line of the two-line headers consistent, so that one could scan the column headers more easily to find the race, or see groupings of Dropouts / Grads  /  College   etc.

 

Thanks.

 

David

FredNajjar
9 - Comet

HI@Newt 

 

Is this what you are looking for? 

 

FredNajjar_0-1616543865348.png

 

estherb47
15 - Aurora
15 - Aurora

@Newt 

 

If you're looking for the headers in the grey bar in the results window to drop down to more than one line, then I'd say no, that cannot be done

 

If you're rendering a table out of Alteryx, then possibly? I'd ask @CharlieS to weigh in here with his reporting expertise!

 

Cheers

Esther

CharlieS
17 - Castor
17 - Castor

Sometimes I feel like Beetlejuice when I appear after my name is used. 😁

 

There is kind of a way to achieve this using the Reporting tools and Rendering to Excel. The idea is that you create two rows that look like a header and stack them vertically. The only downside is that in Excel, they technically are on two rows instead of one tall row. 

 

20210324-MultiRowHeader1.JPG

 

I've attached a workflow to show you this can be achieved, but here's a few highlights:

- All of the tables we're creating will not have headers generated by the Table tool. In the Table tool configuration, there is an option to deselect "Show Column Headings". 

- As mentioned above, create the "header" values as separate tables. 

- Join the tables together and in the Layout tool use "Vertical Merge Contents to Line up Table Columns"

- As an added bonus, when you create the header tables, fill the cells with a color so they look like a real header. 

danilang
19 - Altair
19 - Altair

Hi @Newt 

 

@CharlieS@CharlieS@CharlieS probably has the best solution here, but if you'd like to replicate the Alt-Enter functionality you can do that as well.  For example, with the phrases "American H.S Dropouts", "Hispanic College Graduates", and "Asian H.S. Graduates", you want to replace the first space with a line feed character (#10) so that the line wraps after "American" and "Asian" and "Latin American".   You can do this with a formula tool and the following regex

 

regex_replace([Eduation],"(.*?)\s(.*)","$1"+CharFromInt(10)+"$2")

 

There's also another option you can look at.  When most applications try to wrap text to fit in given length they preferentially use certain characters, hyphen, space, etc to breakup the line.  In your case, you want certain spaces to be treated as if they were normal non-wrapping characters.  There's a character known as a non-breaking space(nbsp), #160 in ASCII, Unicode, UTF-8, and most windows code pages.  Visually it's identical to a space, but when applications see it, they treat it as if it were a letter and ignore it, and try to wrap the line at a another position instead.  You can use this to your advantage by replacing some of the spaces with non-breaking spaces.  

 

Dan

Newt
8 - Asteroid

When I feed your Formula output into a Basic Table, the "Filed 1 two lines" shows up as a single line:  Asian H.S. Dropouts

When I feed the Table into a Layout and into a Render, it's still a single line.

The goal is to be able to force particular breaks in a Table's header.

Am I misunderstanding your solution?

 

David

Newt
8 - Asteroid

Hi Dan,

 

I tried your RegEx solution of inserting the line feed, but when this flow goes into a Basic Table, Alteryx ignores the line feed and puts everything on a single line.

 

I had thought about the @CharlieS solution, but I had wanted to retain the formatting options available for a separate header section. I suppose I can set up row rules to accomplish much the same thing, but I've not tested that...

 

Thanks for trying!

 

David

 

Labels