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

Applying filter in batches and writing data to Excel

hasnain_abbas
5 - Atom

In my input data I have 100 line items comprising on 5 columns and one of the column is name of the client which is a dynamic field. I need to filter data using the client name and then write it to one excel sheet with client name as sheet name. I think I will have tom create a batch macro here but not sure. Please help!

5 REPLIES 5
DataNath
17 - Castor
17 - Castor

Hey @hasnain_abbas, no need for a batch macro here. If you just go to your Output Data tool and 'Take File/Table Name From Field' you can then select your [Client Name] field, ensuring you're using 'Change File/Table Name', as so:

 

0002.png

caltang
17 - Castor
17 - Castor

I solved something similar-ish here: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Replacing-DCS-with-Alteryx/m-p...

 

The concept is to use the Output data tool and Formula tool to get the Sheet Name of your choice exported accordingly via a path. You can filter the names you need, then export the names you need into 1 file with multiple sheets no issue.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
TimN
13 - Pulsar

Here's two examples naming individual sheets or separate files...

hasnain_abbas
5 - Atom

I also need to filter the data for each client as I want to only write data specific to that client in the excel sheet. The number of clients is dynamic and may change every time I run the workflow. So, how to ensure that I am filtering automatically for each of the clients present in the data set and then writing data for that client to the  excel? Thanks!

DataNath
17 - Castor
17 - Castor

Hey @hasnain_abbas, doing what I suggested above will filter/split the data based on changes in the field you pick so you'd get a sheet for only Client A, then client B will have it's own sheet and so on...

Labels