Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Macro only runs on single row

doublej
7 - Meteor

I have a macro to add a single business day that is only running on the first row of my data.  Other macros run on all data rows.  I am new to using macros, any tips to troubleshoot?

 

thanks!

Jason.

3 REPLIES 3
michael_treadwell
ACE Emeritus
ACE Emeritus

The issue is your filter on the [RecordID] near the last step of the macro.

 

I have attached a new macro (without the holiday.xlsx input since I didn't have that file) that includes a few changes:

 

I added an additional row to your Macro Input Tool so now there are two [start] dates in the Text Input. This helps to see what is actually happening for multiple rows of input.

 

Browsing after the Generate Rows Tool you can see that 14 dates are generated, as expected. Seven rows for each of the two [start] dates in the Text Input.

 

Capture.PNG

 

However, later, when you add [RecordID] and filter for 2, this outputs only 1 row. It takes all 14 rows for both [start] dates, numbers them, and then filters all but the second. This means you are only getting the expected output from the first date in [start] (because that is [RecordID] == 2) regardless of how many rows you input into your macro.

 

So the macro is actually running on all rows, it is just the way you are filtering makes it seem like it is only running on the first because you only see one row of output.

 

Capture2.PNG

 

If you need the second row from each given [start] date, I suggest using the Multi-Row Formula Tool and group by [start] to generate [RecordID]. I have included this as an example for you to see in the attached macro.

doublej
7 - Meteor

Thanks, unfortunatly i cant download your file but i understand why it is only taking the 2nd record of each day. 

michael_treadwell
ACE Emeritus
ACE Emeritus

Below is a screenshot of how to set up the Multi-Row Formula Tool to generate a [RecordID] grouped by [start]. This should replace your Record ID Tool.

 

Capture.PNG

Labels
Top Solution Authors