Alteryx Designer Desktop Discussions

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

Need Help : Macro

sabihaS
7 - Meteor

Hello Everyone,

 

I am working on a scenario wherein I am loading survey data(standard template) from a excel and extracting questionnaire and its responses, Its working fine if excel contains survey data for a person but my requirement is to loop through each person. I understand I should be using macro to achieve this however, I am not able to figure it out what parameter to pass in macro so that it loop through each row and its corresponding columns and perform same set of activity for each. so result should have details of 'ABC'  sender too

 

Please can some one advise.

 

Thank you.

6 REPLIES 6
abacon
7 - Meteor

For the Macro, you can make it a Standard Macro and use a Macro input tool. You will need to provide the template schema which could be the file with 1 or 2 rows of data that is in the format you are needing. I have attached the macro you created with some changes to show how this would work. In my example, I used the Text Input example but the File Input with a template file would work as well. Please mark done if this answers your question.

sabihaS
7 - Meteor

@abacon Thank you for your replying. Apologies but I am not able to understand and final result is not as excepted. I can see result are( like cross join) and also for ABC response for Q1 is incorrect (should be 7 instead of 5). My understanding was that macro will run for each row and do transformation and generate result and then move to next row so my final result set would look like 2 rows with Sender details, questionnaire and there responses. Please pardon if I am missing anything obvious. Thank you

abacon
7 - Meteor

Ok, I see what you mean. I believe I didn't fully understand your question, this helps clear it up. Let me dig in a bit further.

 

abacon
7 - Meteor

Here you go, these are updated workflows. You need both a Macro input and a control parameter, I have added a formula tool in the Macro with the column RecordID set to 1. That is the field you will both group on and use to iterate through the records. Additionally the output appears to be correct based on your provided examples.

sabihaS
7 - Meteor

@abacon , Sorry I was not very clear in my original post. The updated workflow works like charm. Thanks again for explaining macro input and the logic for iteration.

abacon
7 - Meteor

You're very welcome, glad to help out!

Labels
Top Solution Authors