Hi Alteryx Community,
I'm having trouble getting started on an Iterative Macro that accomplishes the following:
1. Pass in a name: "tom"
2. Loops through a data set like below:
name | subname | newdate | olddate | olddateend |
tom | bill | 1/1/2012 | 1/1/2012 | 12/31/9999 |
bill | john | 1/1/2012 | 1/1/2012 | 1/1/2012 |
john | mike | 1/1/2012 | 1/1/2012 | 1/1/2012 |
mike | cal | 1/1/2012 | 1/1/2007 | 1/1/2012 |
cal | aaron | 1/1/2007 | 1/1/2007 | 1/1/2012 |
3. Outputs two rows as follows:
recentname | subname | newdate | olddate | olddateend |
tom | tom | 1/1/2012 | 1/1/2012 | 12/31/9999 |
tom | cal | 1/1/2007 | 1/1/2007 | 1/1/2012 |
So, let's say someone changes their name between certain dates and I need to link all of their historical name changes. If they change their name more than once in a day, I ignore it. All names are unique and I ultimately want to pass in a list of names. Can someone help me get started? This would REALLY help me out.
Thank you so much!
Solved! Go to Solution.
I also want to add that the stop condition would be when the olddate <= 2008-08-01. Thanks again!
Hey @rheepa
I hope this is what you are looking for.
I have created iteration macro which will iterate over the data to get a list of all name changes and then that iteration macro is encapsulated in batch macro just to run in batches for each name to iterate the data properly. Then the unnecessary records have been removed from the flow. Also if name change record was happened before 2008-01-01 then it will not be considered.
FYI, Batch macro was indeed necessary as you have mentioned there will be multiple user names to iterate through data. If there was only one user then only iterate macro would have sufficed.
Can I give 100 Likes? This was an amazing solution. I adjusted it to fit my requirements but the fundamental logic from your example was key. Thank you so much!!!
@rheepa my pleasure.!!