LOADING

Type to search

Design Patterns

Design Pattern – Easily changing field names

Ok, this one is not strictly a design pattern, but it’s a quick and simple way to easily rename fields of an input file, to what is expected by an analytic process downstream by using a standard macro’s input configuration.

The scenario where this would be really useful is when you have a process that requires specific field names such as a summarize tool to group by a field, but the input file might change. For example the input file is human generated, or someone extracts a file but then does some ‘clean up’ in Excel which includes renaming fields to something different to what you expect.

In this example we have a formula tool used to extract the month from a date field, and a summarize tool which is grouping on the calculated month to get the total quantity of items sold. If the required fields are renamed to Period and Qty as per the example then the downstream tools fail. Yes you could bring in a select tool to easily rename the fields… but imagine a scenario where you don’t know what the fields need to be called or actually where they are in your dataset they are. This is where the standard macro approach outlined in the video improves the user experience.

Tags:

Leave a Comment

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