In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Cross Tab Tool - Removes spaces and special characters and adds underscores

jalizmaldonado
8 - Asteroid

Hi, the cross tab tool is changing my string value's special characters with underscores. Are there any recommendations on how to proactively avoid this issue? 

 

Here is how the data reads before the cross tab tool.

Before cross-tab.PNG

Here is how the data reads after the cross tab tool.

 

after cross tab.PNG

 

Here is my entire workflow. 

Change.PNG

 

6 REPLIES 6
TomWelgemoed
12 - Quasar

Hi,

 

I'm not sure you can change that, but why don't you add a dynamic rename after the cross-tab to rename it to the name you want?

 

Here I've just first renamed the column using a number in the cross-tab and then I use that number back to the original source to relabel it to the text that contains the special characters.

 

Hopefully that helps? 

 

Dynamic rename.png

 

dynamic rename 2.png

Qiu
21 - Polaris
21 - Polaris

@jalizmaldonado 

As @TomWelgemoed  pointed out, the cross tab tool would change the field name.

I usually do a RegEx_replace with Dynamic Rename

Capture7.PNG

echuong1
Alteryx Alumni (Retired)

Using the cross-tab will essentially remove all non-word characters.

 

I think the easiest and most dynamic way to solve this is to use the Dynamic rename tool. The cross-tab essentially replicates the following regex:

Regex_Replace([Field1],"[^a-zA-Z0-9]",'_') 

 

Given that, I like to create an "old" and "new" field name reference list. Once I have that, I can use the dynamic rename after the cross-tab to revert the names back to their original form.

 

echuong1_0-1612844607319.png

 

Jan_C_Ott
6 - Meteoroid

Dynamic rename doesn't help in the situation I googled and found this forum for. If you have headers like Permanent - City/Town and Name
Mailing - Address Line 1 it replaces it with Permanent___City_Town and Name_Mailing___Address_Line_1. You can't dynamically rename that correctly especially if you need to union it together with another flow stream that didn't get cross tabbed. Especially if the client is stubborn about there original header names.

JackTomlinson
5 - Atom

Dynamic rename should work using echuong's method, if not I've used the following alternative:

As far as I'm aware Cross Tab outputs column names in Alphabetical order, you can therefore combo a Summarise tool - grouping by name followed by a sort function to sort the Name Alphabetically.

If you use a dynamic rename with "Take Field Names from Right Input Rows", using "positional rename" you can then replace the column headers which have been updated by the Cross Tab Function with the original field names

 

Cross Tab renaming.PNG

 

 

bkclaw113
10 - Fireball

I like your solution @JackTomlinson  but if you have  fields included in the Group By for the Cross Tab, those fields come first in the output. To get around this you can simply include a text input with the group by fields, and union that to your sorted output from the summary tool.

Labels
Top Solution Authors