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.
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.
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.