Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Multiple Field Find and Replace

rsidani
6 - Meteoroid

    I am making an app inn which a user can load a product file, select specific attributes of that product, and replace it in all locations of our internal data.  There are two challenges.  First, I cannot transpose the internal data to join on the selected fields as it will create billions of records.  Second, I need to keep the order of the fields the same.  So, ideally I would find the data from the user file and replace the data in the internal data for every field while keeping structure intact. 

    I can use a join to connect the two and get the new values.  If it was manual, I could then rename the new fields and move them over to where the originals were, but I need to automate that rename and movement in the app.

  I'm including an image of sample data.  Imagine the user uploaded a file with the new Height, Width, and Depth fields and wanted to replace the data in the image.  The real data would have about 300 fields and 100,000's of rows.

 

2018_12_17_10_49_46_Alteryx_Designer_x64_New_Workflow5_.png 

Thanks,

 

Robert

2 REPLIES 2
Claje
14 - Magnetar

Hi,

I've attached a workflow which takes advantage of the CReW macro "Dynamic Formula".  We read in the source Data and use it with a Sample tool to build a list of all fields that have to be included.  We then union that to the user input, which can contain any number of columns, and join the two on the "Key" value.

 

We then write a dynamic formula to compare the "Right_" fields (which come from the user input), and if they are not null, we replace the values from the data source.  We then deselect all "Right_" columns from the dataset.


This may still take some time to run for 300 columns, but I've used approaches like this for similar datasets, and it is usually pretty quick.

rsidani
6 - Meteoroid

Exactly what I needed!  Thank you!

Labels
Top Solution Authors