Free Trial

Alteryx Designer Desktop Discussions

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

Crosstab Columns to go to 2 different output files based on another column's value

sophabraham95
7 - Meteor

The names and account numbers are dynamic and can change.

We will create separate file based on acctNum as the file name

Can you help me with this issue of how we can dynamically have the columns pertaining to the respective acctNum come up within each file, I have also attached the Alteryx workflow for your reference

 

So I have the below Data:

acctNumNameIDQTY
1234TomTTTT0.0008
1234TomCCC0.8
1234TomEEEE0.2
1234JohnTTTT0.0007
1234JohnCCC0.72
1234JohnEEEE0.88
4567LinFXAIX0.0001
4567LinIEF0.3
4567LinMBB0.9
4567MaxFXAIX0.0001
4567MaxIEF0.3
4567MaxMBB0.9

 

when I crosstab this data, I get:

acctNumIDJohnLinMaxTomValue
1234CCC0.72  0.81.52
1234EEEE0.88  0.21.08
1234TTTT0.0007  0.00080.0015
4567FXAIX 0.00010.0001 0.0002
4567IEF 0.30.3 0.6
4567MBB 0.90.9 1.8

 

Now I want one set to go into file named 1234.xlsx as below:

acctNumIDJohnTomValue
1234CCC0.720.81.52
1234EEEE0.880.21.08
1234TTTT0.00070.00080.0015

 

and the other set to go into file named as 4567.xlsx as below:

acctNumIDLinMaxValue
4567FXAIX0.00010.00010.0002
4567IEF0.30.30.6
4567MBB0.90.91.8

 

But currently am getting as below:

file 1: 1234.xlsx

acctNumIDJohnLinMaxTomValue
1234CCC0.72  0.81.52
1234EEEE0.88  0.21.08
1234TTTT0.0007  0.00080.0015

 

file 2: 4567.xlsx

acctNumIDJohnLinMaxTomValue
4567FXAIX 0.00010.0001 0.0002
4567IEF 0.30.3 0.6
4567MBB 0.90.9 1.8

 

 

4 REPLIES 4
cjaneczko
13 - Pulsar

If they are Dynamic, how do you know which Accounts should go into which file?

sophabraham95
7 - Meteor

the file name is the account number itself. Its the columns that have to go into the respective files, as per the account number.

 

ie. John & Tom for 1234 and Lin & Max for 4567

sophabraham95
7 - Meteor

Using iterative macro from this post I was able to achieve this. https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Macro-to-process-ALL-records-4...

binuacs
21 - Polaris

@sophabraham95 a batch macro is the suitable approach for your use-case

image.png

Labels
Top Solution Authors