We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Adding columns before a specific columns

DanielCarro
8 - Asteroid

Hi,

 

I need some guidance/advice to approach this task on alteryx.

 

I have a range of columns from A:CL but columns  A:X can have more columns to be added and require the rest of columns to move to the right.

 

For example:

COL XCOL YCOL Z
PensionER PensionEmployee ID
10.3625.36123
15.6928.96456

 

But if there are any new column updates, these shall need to be taken into account and Col Z to move right.

Expected Result:

COL XCOL YCOL ZCOL AACOL AB
PensionER PensionCar AppCar MileageEmployee ID
10.3625.365.695.9123
15.6928.968.6995.2456

 

Note: Columns from AB to the end always remain the same, just the middle data is 'dynamic'

 

Kind Regards,

Dan

6 REPLIES 6
DataNath
17 - Castor
17 - Castor

Hey @DanielCarro, I'm not sure I'm following the logic properly as the provided desired output doesn't seem to follow this i.e. Col Z doesn't move right as you state. However, I just thought I'd show an example of how you can set up your workflow to accommodate for new fields in a certain position.

 

The first time you run your workflow with the base order, i.e. fields that will always be there, bring on a select tool like so and move the [*Unknown] field to where you want new fields to be inserted on the next/future runs:

 

DataNath_0-1667920233927.png

 

Now, if I do another run and add in two more fields, they'll appear where these previously unknown fields are according to the Select position i.e. before COL Z:

 

DataNath_1-1667920321130.png

DataNath_2-1667920328090.png

 

I know the order is different in your example i.e. Z before AA/AB but this shows the functionality in telling Alteryx where to place future/unseen fields.

DanielCarro
8 - Asteroid

Hi DataNath,

 

The columns which are added could be two or more, I will never know. And Col Z always will move to the right, so from Z to CA (these columns are always the same but still need to be shifted to the right as per the new columns are added)

DataNath
17 - Castor
17 - Castor

@DanielCarro ok, so can you try what I've mentioned above and just move the [*Unknown] to above COL Z?

DanielCarro
8 - Asteroid

Sorry, forgot to mention that from columns Z towards the right it has formulas in place which need to be in place

 

DataNath
17 - Castor
17 - Castor

@DanielCarro can you please post a more comprehensive sample of what you're starting with, what can possibly come in as new fields and where you'd expect them to end up then? Thanks

DanielCarro
8 - Asteroid

@DataNath, so we have a spreadsheet which has data from columns A:Y and there could be me more column/-s added, but from columns Z onwards up to CY there are columns which have columns which are unique and don't change, but these have formulas which extract data from columns A:Y. I hope this clarifies.

I think I need to use a blob section to retain the formulas

Labels
Top Solution Authors