Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語

Want to get involved? We're always looking for ideas and content for Weekly Challenges.


Challenge #86: Create a Macro that Generates Past Dates

Alteryx Alumni (Retired)

Last week's solution can be found HERE!


Create a macro that generates a table with the date and the day of the week for all dates from a given starting date to today. The user should be able to select the start date.

Bonus 1: Add a selection that will allow the macro user to select whether or not to include weekends.
Bonus 2: Create a duplicate macro that's encrypted so that no changes can be made. Leave the first macro on your canvas unencrypted so other challenge-takers can observe how your macro was built.

11 - Bolide

Attached Macro


11 - Bolide

Solution attached.  Interested to see how people handled the skipping the weekends.

16 - Nebula
16 - Nebula

First time attempting the weekly challenge! I attached my macro (both encrypted and not) to this post.


EDIT: When I am creating the macro, I can use this expression in the Generate Rows tool for the Initialization Expression: "%Question.StartDate%" to get the initial start date from the date interface tool. However when I run the macro, I noticed that the initialization expression somehow automatically gets changed to whatever I set the value to in my workflow configuration. Does anyone know why this happens?

9 - Comet

Making the workflow was quick, but converting it into macro was a bit challenging as I am not using Interface tools a lot.


Screen Shot 2017-09-18 at 17.46.26.png



14 - Magnetar

This one was relatively quick/easy for me - but mostly because I have a lot of exposure to dates and table creation.

I was able to get this done in four tools (excluding interface).  Generate Rows->Formula->Filter->Output.  Curious if there's a way to remove the filter tool with a more complex Generate Rows formula, and which option is more performant.
17 - Castor
17 - Castor
Generate Rows > Formula > Filter
ACE Emeritus
ACE Emeritus

My solution! Ah, it feels good to finally be caught up on Weekly Challenges after my 3-week vacation... Which, if I use this spiffy new macro, I can use it to see a list of exactly which days I was on vacation! Cheers!


Included Bonus 1 & 2 in the attached workflow! :)
15 - Aurora
15 - Aurora

I had hoped to leverage the Detour tools, but they were throwing errors at me, so went another route. This way took fewer tools in the end, but the Detours make more logical sense. If I get that method working, I'll post too.

Happy with the efficiency of only 3 main tools in the workflow + 2 interface interactions +1 action + 1 output.

And I learned something new and powerful!! Didn't know one could encrypt macros. 

Generate Rows tool generates all of the dates between the chosen date and today

Then, a Date Time Parse tool creates the Weekday column (%A is the custom format)

Finally, a check box (when checked, macro will skip weekends), that feeds its value into a filter. When the checkbox is true, the weekend days are filtered out, and when false, all dates show. IIF took care of that for me. I wasn't sure if I could have just the field itself in the "value if false" so I used !IsNull([Day of Week]) to show all days of the week.

7 - Meteor

My first macro and my first challenge!