We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Grouping output sheets different columns

saiirangam
8 - Asteroid

Hi Everyone , 

 

Problem Statement:  I have 100 rows of data with 10+ Columns, I want to write this data into different sheets based on Column field State, my Challenge is here we have pre-defined columns required for each state. I need only those columns for each state sheet. 

 

Approach now : we are using Filter to get each state and using select tool to get the data.

 

DO we have any better approach than this .?

 

 

6 REPLIES 6
FrederikE
13 - Pulsar

Hey @saiirangam,

 

You can use a single output tool to write all different sheets. The "Take Table Name From Field" Option allows you to do so. This creates a sheet for every group. 

FrederikE_1-1685697091107.png

 

 

saiirangam
8 - Asteroid

Thank you , Lemme rephrase my question

 

I need to pick different columns from the incoming data base don the select I am writing into , all the sheets will not have same data

alexnajm
18 - Pollux
18 - Pollux

If it's a unique selection of columns for each value in the State column, then you'll likely have to do each one separately. Otherwise for any that are the same, the approach by @FrederikE is your best bet

alexnajm
18 - Pollux
18 - Pollux

You might be able to use a Dynamic Select built into a Batch Macro, but only if you have the list of columns to be selected for each unique State value

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@saiirangam From what I understand, I think you're trying to achieve this:

Take note of the grouping column in my sample data, that's emulating your 'State' column. 

BS_THE_ANALYST_0-1685709415460.png

I want 3 separate sheets within one excel workbook. I want a tab for each group, and on each tab, I only want certain columns:

BS_THE_ANALYST_1-1685709497675.png

 


I've attached a workflow. Download it, give it a run & check the output Excel file. See if it's achieving what you want. I basically said, group 1 should only have field 2, group 2 should only have field 3 etc. You can change the desired columns in the Select tools.

All the best,
BS

 

 

All the best,
BS

LinkedIN

Bulien
OllieClarke
15 - Aurora
15 - Aurora

@saiirangam 

I think the best approach here is to make a batch macro. You can use the dynamic select to just keep the columns you want per state

 

From a lookup like this:

OllieClarke_0-1685723109788.png

You can feed this into the control parameter to update the dynamic select in the batch macro

 

Make sure you group by your state field in the batch macro configuration

OllieClarke_1-1685723159642.png

This filters the input of the macro to where the state is identical to the control parameter.

 

OllieClarke_0-1685723232848.png

OllieClarke_1-1685723244059.png

 

OllieClarke_2-1685723510935.png

 

 

Hope this helps,

 

Ollie

 

Labels
Top Solution Authors