My Alteryx Macros: DateTime Scaffolder

Last year I wrote about downloading Alteryx macros I’ve made from Github. Today I’ve added a macro called DateTime Scaffolder to create a scaffold for your date fields. It builds a scaffold for your data at a chosen time interval of seconds, minutes or hours and adds bins to your DateTime field ready to join onto the scaffold.

This macro is great for aggregating your data from timestamps that are too granular and for filling in the gaps of where there is no data, before using data science tools that require a structured data set.

DateTime Scaffolder looks like this in your workflow with one input and two outputs, one for your data and the other for the scaffold – you have to do the joins and aggregations you want separately afterwards!

In the configuration pane you need to choose the field you’re scaffolding and then choose the time interval you want to scaffold it at. Be careful and choose an appropriate interval, there are 86400 seconds in a day so only scaffold to that level if you’re analysing data over a short time period.

The scaffolding options you have available in the macro from 1 second to daily.

By default the macro scaffolds between the earliest and latest timestamps in your data but you can override those start and end times by ticking the overrride boxes.

Ticking the override options presents calendars to choose manual start and end dates.

Once you’ve configured the macro and run your workflow your data will come out like this:

You can then join your data on the bin field and aggregate any measures you choose downstream to take a complete picture of your time series data.

If this look useful to you, this macro is hosted on my GitHub and you can download my full set of macros here!

Finally, I want to say a huge thank you to Gwilym Lockwood for testing this macro and squashing a ton of bugs it made it to release.


Leave a Reply

Your email address will not be published. Required fields are marked *