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.
Continuing my series on Alteryx macros and apps I’ve made & hosted on Github, my next one is a quick converter to turn CSVs into native YXDBs. It allows to select a csv file and it will write it as YXDB file with the same name in the same folder location. You can watch a demo of the app running below:
The app in its entirety is only 5 tools big with 3 interface tools, an input and an output tool but sometimes its the simplest automations that really help you streamline your processes.
Last month I posted about downloading Alteryx macros I’ve made from Github. Here I’m going to walk you through my first set: Save Files with Timestamps. These macros allow you to save CSVs, TDEs and YXDBs with timestamps appended on the end and if you want to get into them can be edited to work on other file types too.
I use these a lot when when developing workflows and what to test different output structures or occasionally when I have scheduled workflows where I want to keep track of daily outputs separately.
Each macro follows a similar structure of asking for your file name stem, whether you want to append the date & time or just the date and where you want to save the file.
This is the YXDB output macro and has the simplest base structure.
The CSV output macro asks what file delimiter you want to use.
While the TDE output tool has the dropdown menu for Create New, Append or Overwrite.
The DateTime or Date only dropdown has options like this and appends timestamps in yyyy-mm-dd_hh-mm-ss or yyyy-mm-dd formats respectively.
Once a month or so I find myself making a macro or set of macros that could have wider use. Now I’m saving them to GitHub when I can. There will be some cross posting of macros here that I have saved to the Alteryx Public Gallery before but I find it easier to use GitHub for effortlessly publishing updates and it is also easier to share my library in bulk from here.
I will write up the macros that are already in my repository soon, but for now you can find them here and explore for yourself: