Alteryx Designer Desktop Discussions

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

Automatically select first n columns as key fields for transpose

Cristian_Ionescu92
6 - Meteoroid

Hi all,

 

Is there any way I could set Alteryx to select the first n columns (first 3 in the attached example) for transposing?

 

Problem is that my data source is a pivot table which has dates in column names. The dates change from one week to another and I want to be able to keep the first n columns(which remain unchanged from one week to another) as key fields and the rest as data fields.

6 REPLIES 6
jdunkerley79
ACE Emeritus
ACE Emeritus

Use a dynamic rename to relabel the first 3 columns with a text input to give a set of names.

Do the transpose

Then use a Field Info to get the original names and relabel first three again.

2016-05-16_14-01-45.jpg

 

Attached a sample.

Cristian_Ionescu92
6 - Meteoroid

I am not sure if I follow.

 

The idea is that I am not bothered by the first three columns, which remain always the same, but by the next 7 ones which every week have a different name.

 

 

Could you, please, provide more information?

jdunkerley79
ACE Emeritus
ACE Emeritus

Sorry misread - I thought first three changed.

 

All you need do is make sure 'Dynamic or Unknown Fields' is ticked in the Transpose

And set the Warning to Ignore Missing Fields.

Should then be fine.

 

Attached you sample update to do this.

 

 

Cristian_Ionescu92
6 - Meteoroid

Thank you!

 

This helps me, however, it almost works well (I have some blank spaces in the column names of my real data and it doesn't keep the same columns selected as Key Fields when transposing).

 

I am searching now a way to remove the whitespaces from the column names.

jdunkerley79
ACE Emeritus
ACE Emeritus

Easiest way to fix that is to use a Dynamic Rename tool in formula mode.

 

http://help.alteryx.com/9.5/DynamicRename.htm

JohnY
7 - Meteor

works like a charm man! very nice

Labels