community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Join rows with different set of columns (Schema) after each iteration

Highlighted
Meteor

I am running a batch macro in my Alteryx workflow which gives 1 row as an output with different set of fields in each iteration. I need to append all these rows together by creating a new column, if required, after each iteration. Those rows which do not have values for the corresponding column should be replaced by 0. 

 

Any idea how to do it?

 

MACRO OUTPUT:

Iteration1

Nameidcourse1course3
Kim23441234

 

Iteration2

Nameidcourse2course3
Mia34452344

 

Iteration3

Nameidcourse1
Joe322235

 

After each iteration i need to append the output to a final output structure as below

Final output

Nameidcourse1course2course3
Kim234412034
Mia344502344
Joe32223500

Here you go :) Let me know if that helpesave.PNG

Meteor

thanks but my output is from a batch macro. at each iteration i get one output and the next iteration gives me a different set of columns. if i use transpose like how you did, then i need to dynamically change the key fields in transpose. is there a way to do that?

Alteryx Certified Partner

Hey @GaRaGe

 

In your batch macro interface designer settings choose this option:

 

batchsettings.png

 

Then add a data cleanse after to replace any nulls with 0

Meteor

thanks a bunch. didnt know this configuration. works now. 

No you would not need to change anything manually, coz it will be done dynamically. That is the beauty of the transpose/crosstab solution
Labels