Alteryx Designer Desktop Discussions

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

Column Sort Order

BK209
5 - Atom

HI All

 

Im having challenge with column name rename and sort order.

I have below input data which that I parsed it from Json output file. I have 250+ columns and few of those column names have % special character which cannot be ignored.

 

Column NameColumn Values
V100
AA200
C300
B400
% E500
V10
AA20
C30
B40
% E50

 

Expected final output should be like 

VAACB% E
100200300400500
1020304050

 

First issue: Column order

I have used multi row formula to create RowID and then used cross tab to group the column headers. When I use multirow the columns are automatically sorted in alphabetical order and % columns takes precedence. 

 

Second issue: Column names have spaces (eg First Name ) getting replaced with "_" (First_Name_). 

Column NameColumn Values
%_E500
%_E50
AA_200
AA_20
B_400
B_40
C_300
C_30
V_100
V_10

I tried dynamic replace , Dynamic select, formula tool to replace each column with original column name but they getting sorted incorrectly because I have 250 columns so if I use sequence id appended to column names. My 11th column comes second instead of 2nd ranked column.

 

Column NameColumn ValuesNew Column
% E50011% E
% E5011% E
AA2002AA
AA202AA
B4004B
B404B
C3003C
C303C
V1001V
V101V

 

Appreciate any help here! Thanks

3 REPLIES 3
jasperlch
12 - Quasar

Hi @BK209 

 

I would suggestion creating a new field called ColumnID then using this field as Column Headers in the Cross Tab tool. Finally use Dynamic Rename to get the column names back.

 

Capture.PNG

BK209
5 - Atom

HI

 

Thank you so much that helped me lot. Appreciate your help.

 

 

Shohn
7 - Meteor

Here is a macro that mimics the crosstab tool with added asc/desc header columns.

Labels