Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
The Expert Exam is now live online! Read about the specifics and what it took to bring it to life in the blog by our very own Elizabeth Bonnell!

Renaming headers using dynamic rename tool

Highlighted
6 - Meteoroid

 

Hi Team,

 

I'm an alteryx beginner. I'm facing a problem with renaming my headers. 

 

Consider this sample excel report layout-

 

   Primary IdOwner IdType
NameAccountData Type    
John SmithRegionalA10011001Class A
Jane DoeGlobalB1002131Class B
John DoeRegionalB1003435Class A

 

I am trying to get the header name for my data but the issues I'm facing are-

  • Header names are given in 2 different rows instead of first row only. Wherever the header name in given in the second row, the respective column is blank in first row and vice versa (as seen in the sample data above)
  • Not all columns are present every time and the order of columns keeps changing, due to this i can't use a text input with header names for dynamic rename as then columns get renamed incorrectly.
  • If I just let dynamic rename tool name the columns on the basis of the first row then the columns with their header name in second row get renamed randomly like (Field_SomeRandomNumber) as they were blank. This random header name keeps changing everytime time i update input file with a new report so it is problematic as i need to use filter/formula tool on some of these columns and since its random and changes every time, i run into issue with target names.

 

Please suggest a solution.

 

In the attached workflow. Please look at the "Beginning Debt Check" container. I'm comparing report of 2018 with 2019. So set 1 of report is included in package and the 2nd set (to see how the reports vary) is attached externally.

 

Additionally if you look at how I'm importing data from excel sheets. I'm using three different inputs to import data from 3 different sheets of the same file. How can i do this in one import? I tried searching but since the structure of these 3 sheets isn't the same so most solutions i found didn't work.

Highlighted
7 - Meteor

This is one way of solving based on the sample table you share (because I wasn't able to open the workflow you shared as the input files were linked to your desktop - to share the input files you may need to package it and then upload)

Workflow:

mmishal001_0-1577911526364.png

Input:

mmishal001_2-1577911571366.png

Output:

mmishal001_1-1577911553687.png

 

Hope this helps.

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @Jaswinder,

 

Welcome to the community! I wouldn't go down the multi-row formula route as if the column headers or the number of columns change you would need to amend your workflow, i would be tempted to go down the route of cross-tabbing and transposing. Below is a screenshot of my workflow (also attached) which uses the snippet of data you gave us.

 

image.png

 

Also in order for us to be able to use your attachment it needs to be saved as a packaged workflow (.yxzp) which is in effect a zipped file containing extracts of any local files you've used in your workflow (currently when we run these files can't be found and error out).

 

To save the workflow as a .yxzp you'll need to go to Options -> Export Workflow -> Save

 

image.png

 

If you can attach your new packaged workflow i can take a look, I've also attached my example for you to download and look at.

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

 

 

Highlighted
7 - Meteor

Thanks @Jonathan-Sherman! I agree this is the right way to go. Appreciate the way you have structured your answer!

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

No problem at all @mmishal001! Always nice to have more than one way of solving these problems.

 

Regards,

Jonathan

Highlighted
6 - Meteoroid

Thank a lot @mmishal001 and @ for your answers.

 

I have updated the workflow as a package in the original post. I have included a second set of report externally so that u guys can see the variations.

 

Additionally i if you look at how I'm importing data from excel sheets. I'm using three different inputs to import data from 3 different sheets of the same file. How can i do this in one import? I tried searching but since the structure of these 3 sheets isn't the same so most solutions i found didn't work.

 

Thanks again!

 

Labels