Alteryx Designer Desktop Discussions

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

Output separate excel files removing blank columns

asiu
6 - Meteoroid

Hi,

 

I am taking my input file below and then output to individual excel workbooks based on the Company. The issue I am running into is my output is including the Corp column that is not associated with the Company. Is there a way to remove blank columns in my output?

 

There are many more Companies and Corps, this is a small sample. Ideally, I wouldn't want to setup individual formulas/select/filter tools

 

Thanks for any feedback!

 

Input:

Input.png

 

Current: Output to 2 separate excel file

Output1.png

 

Goal: Output to 2 separate excel files without B Corp column showing up in Company A (and vice versa, without A Corp showing up in Company B). 

Output.png

 

9 REPLIES 9
acarter881
12 - Quasar

Hello, @asiu.

 

One idea is to use a batch macro in which you provide the company names to the Control Parameter and the workflow will loop over the company names (such as by changing the company to filter for in a Filter tool), each iteration outputting a different company Excel file.

 

Here's a helpful article on getting started with batch macros: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Knowledge-Base/Getting-Started-with-Batch-...

binuacs
20 - Arcturus

@asiu as @acarter881 mentioned you need a batch macro for your use case. Attaching a sample workflow which will create two excel output files based on the company name and remove the unnecessary fields.

Screenshot 2023-07-14 204824.png

asiu
6 - Meteoroid

Thank you for sharing the workflow!

 

I tried running the workflow and only 1 output (Company A) appeared. I am tracing it back to the Filter where it is set to Company = Company A and was wondering if that was the reason why I am only getting 1 rather than both files.

jdminton
12 - Quasar

Is there a reason that you need it to say "Corp A" or "Corp B" as the column header for the output? The attached will work without having to create a macro.

Snag_bbe0552.pngSnag_bbe1ee5.pngSnag_bbe2a00.png

asiu
6 - Meteoroid

Yes, I need Corp A and Corp B as headers. The full set of data will have multiple Corps (e.g. Corp A-1, Corp A-2). Thanks!

jdminton
12 - Quasar

Can you provide some additional data? The output you provided shows that each Corp will have its own Excel file and 1 column. I'm not sure what you're trying to get to overall. I'm guessing it will just be a modification of what I sent before.

asiu
6 - Meteoroid

Yes, please see below. The main issue I am having is making sure none of Corp As are appearing in Company B's file (and vice versa, non of Corp Bs are in Company A's file). 

 

Input:

input.png

 

Goal: Output to 2 separate excel files, Company A vs B. 

output.png

jdminton
12 - Quasar

Hopefully the macro is included in the package, but this should do what you need. Take a look and mark as a solution if it works for you.

asiu
6 - Meteoroid

Amazing! The macro and output works!! 

 

Thank you!

Labels