Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Output to Multiple Excel Files and Tabs

nadiahghzli
6 - Meteoroid

Hi, I am currently planning to generate multiple excel files and tabs based on two columns. The idea is illustrated as below:

Screenshot 2023-05-23 165240.png

 

Does anyone know how to generate output as above? Preferably with the naming as well (i.e., not the default name of the output sheet e.g. Sheet 1, Sheet 2 etc.). Thank you in advanced !

10 REPLIES 10
FrederikE
13 - Pulsar

Hey @nadiahghzli,

 

You need to adjust the file path, but this should do:

FrederikE_1-1684834209169.png

 

 

 

 

binuacs
21 - Polaris

@nadiahghzli One of doing this

binuacs_0-1684834137416.png

 

nadiahghzli
6 - Meteoroid

Thank you so much for replying to this post ! However, I am unable to proceed with the suggested methods as I am dealing with a very complex data (e.g. numerous input). I have attached an example of the workflow and sample data. Currently, the workflow would generate 2 excel files (i.e., Bookmongers & Foyles) but only one tab that consists of all the genre. 

 

I need to generate excel files based on the bookstore names (i.e., Bookmongers & Foyles) and a maximum of 4 tabs (i.e either or combination of 4 genres).

Example:

Screenshot 2023-05-24 153317.png

 

Appreciate if anyone could assist me on this. Thank you !

FrederikE
13 - Pulsar

Hey @nadiahghzli,

 

I am not able to rebuild this working as i dont understand what is your macro trying to achieve. I am not sure I quite get it. The first filter always filters out everything as it seems. 

 

 

 

 

 

Also to send workflows much easier: 

FrederikE_0-1684920541521.png

FrederikE_1-1684920543360.png

 

 

This will save a ".yxzp" a packed workflow including all data. 

 

 

nadiahghzli
6 - Meteoroid

Hi, FrederikE. My apologies. The macro included is a batch input. I have attached the .yxzp and the batch input macro for your perusal. Thank you very much for your assistance !

FrederikE
13 - Pulsar

Hey @nadiahghzli,

 

Yes, I can open the workflow. I don't understand why you are using this macro - This macro is what is not functioning correctly. Without understanding it I can't fix it. Your first filter always filters out my input Excel file path (attached screenshot). What is this filter doing, and why and what is with the next one(s)?

If you just want to separate Excel files, you can use something like 

 

CONTAINS([Path],".xlsx")

 

But overall, what should the macro output? Can you maybe give me an example of what you want there? 

 

FrederikE_0-1684921872531.png

 

nadiahghzli
6 - Meteoroid

Hi, FrederikE !

 

The macro's purpose is similar to a dynamic input tool, however, the input files doesn't need to be on the same schema. I have used the macro to combine the same tab between two excel files (as the two tabs has different set of columns), which would then generate the following outputs:

Screenshot 2023-05-24 181058.png

Screenshot 2023-05-24 181557.png

 

I have attached excel files (i.e., manually prepared) that consist of what I am planning to generate from the overall workflow. Thank you !

FrederikE
13 - Pulsar

Hey @nadiahghzli,

 

So this got quite messy, I am not really able to figure out what you do and why you do it, so I restarted it. I have provided a workflow that reads all Excels including all sheets and unionizes all the data. 

I would recommend a separate process for non-excel files to not mix this logic up (F Output of the 1st filter) and then union it later on. 

Main Flow:

FrederikE_0-1684926630312.png

 

Macro to read sheetnames:

FrederikE_1-1684926643402.png

 

Macro to read all Sheets: 

FrederikE_2-1684926653437.png

 

nadiahghzli
6 - Meteoroid

Hi, FrederikE,

 

Thank you for the suggestion on the input ! However, I would like to separate the table between the tabs "Bought" and "To Buy" as I would like to maintain the columns name and not unionizes the data. (please note that the info provided is a sample data and I am currently working on a very complex data).

 

Furthermore, appreciate if you could assist me on the output part of my workflow as I am currently stuck on that. I would need to generate excel files based on the bookstore names (i.e., Bookmongers & Foyles) and each files contains a maximum of 4 tabs based on the genre.

Screenshot 2023-05-25 094250.png

 

 

My apologies if I am not clear. This is the third day that I am using Alteryx. Really appreciate your constant help !

Labels