Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Split out mapping tables into separate Excel sheets

williamburge
6 - Meteoroid

I have an Excel sheet that has a few hundred sets of mapping tables all stacked on top of one another, and would like to split each table out into its own sheet. The data is structured like so:

 

Table 1Mapped Table 1
1Apple
2Orange
3Pear
  
Table 2Mapped Table 2
1Blue
2Red
  
Table 3Mapped Table 3
1New York
2California
3Illinois
4Florida

 

The big thing to note here is that the length of each table is not consistent, but each table is separated by a blank row. Ideally Tables 1, 2, and 3 will each have their own new Excel sheets, positioned to sit in columns A and B within that sheet.

 

Appreciate any possible help in advance! 

3 REPLIES 3
Thableaus
17 - Castor
17 - Castor

Hi @williamburge 

 

See solution:

Sol13213.PNG

- Name fields A and B

- Data Cleansing to make sure the empty rows are completely empty

- Multi-Row Formula to assign numbers to every sheet everytime a blank row is seen. 

- Creates name of the Sheet. Sheet + Number

- Filter empty rows and rows that contain "Table". I guessed you wanted to take these rows out.

- Output to Excel - You check the option "Change File/Table Name" and select the field with Sheet Numbers to do that.

 

See if it works for you. You may need to change the Output path to try your own version.


Cheers,

williamburge
6 - Meteoroid

Thanks Thableaus! This is super helpful and almost exactly gets me what I need. Two follow-up questions though:

 

1. I forgot to mention, the tables also have a sub-heading that shows the Type of data - the wording in column A is always the exact same. Is there an easy way to remove these rows (by looking up entries that say 'Type:' ?)

 

 

Table 1Mapped Table 2
Type:String
1Apple
2Orange
3Pear

 

2. In the output of each sheet, I'd like to keep Table 1 and Mapped Table 2 as the headers in Row 1. I figured out how to include them, but I was still pulling in A and B the row above. Is there any way to not include the Field headers as the first row in each output sheet?

Thableaus
17 - Castor
17 - Castor

@williamburge 

 

1) You can get rid of "Type" rows by doing the same thing I did with Table. "Contains([A], "Type")" in the Filter Tool

 

2) Quickest workaround I found was to rename fields "A" and "B" to whitespaces. A became 1 whitespace and B became 2 whitespaces.

 

If you needed different headers (different schema), I'd suggest a building a macro.

 

New WF appended.

 

Cheers,

Labels