Before diving into SQL, Tableau Prep, Alteryx, or whatever tool or programming language you use to prepare your data for analysis, there is one important step that many of us tend to forget. I certainly did. Planning. When I was first given a Preppin’ Data challenge, I spent a little time reading the requirements, and as soon as I thought I had a vague idea of what I was being asked to do, I opened Tableau Prep and got my hands dirty. Of course, after almost every step, I found myself going back to the instructions, rereading the requirements, and checking what the expected output was supposed to look like. Not exactly the most efficient approach.
But, like almost everything else in life, you will eventually find someone who has already banged their head against the same problem and, fortunately for the rest of us, come up with a roadmap. In our case, that person was Carl Allchin, our Global Coach at The Data School. His advice? Plan. Yes, plan. Get yourself a pen and paper (or a pencil, if the mood strikes), and sketch out a roadmap from where you are (your input) to where you want to be (your output).
Understand the Problem Before Choosing the Tool
Start by asking yourself a few simple questions:
- What does my input look like?
- What does my expected output look like?
- How many columns and rows do I have, and how many do I need?
- What does each row represent in my input and output?
- What information am I missing?
- What information do I no longer need?
- What logical steps would take me from my input to my output?
And when I say identify what you are missing, it doesn't necessarily have to involve some grandiose calculation. It could be as simple as counting the rows and columns in your input and comparing them with your expected output. Perhaps your input has two columns and nine rows, while your expected output has ten columns and ninety rows. Where are those additional rows and columns supposed to come from? What transformations need to happen to bridge that gap? Only once you logically understand where you want to go and what needs to happen along the way should you start concerning yourself with which tools in your toolkit will get you there.
Think of Data Preparation as Navigating New York City
I know this sounds simple, but here is a little mental exercise that I find helpful. Imagine your input is your home, and your output is your destination. If you live in the city (of course, the only city, NYC), before leaving home, you probably want to know which subway line to take, whether you need to transfer, which station to get off at, and how many minutes you need to walk in which direction to reach your destination.
Now imagine that the moment you hear the 1 train is running normally again at the 125th Street station on Broadway, you excitedly jump out of your apartment and rush toward the subway. There is just one minor problem: you haven't actually figured out where you are supposed to go. Now you're standing at the turnstile, frantically texting your friends, checking Google Maps, and trying to figure out your destination. And as an NYC subway advertisement reminds us, in words to the effect of “Keep a tap on your tap,” you should be prepared before reaching the turnstile. Nobody likes the person who holds up everyone behind them while trying to figure things out. Meanwhile, the New Yorkers behind you are questioning every decision you have ever made in your life.
The same principle applies to data preparation. Opening Tableau Prep or writing your first line of SQL without understanding your destination might feel productive, but movement is not necessarily progress.
Plan First, Build Second
The point of planning is not necessarily to know every technical detail before you begin. You might still encounter unexpected problems, discover a more efficient approach, or have to revise your original plan. The point is to have a logical understanding of the problem before trying to solve it technically. One of the beautiful things about approaching a data preparation challenge this way is that your logical plan is largely independent of the tool you use (this will also make life much easier, both for you and for anyone you ask for help. Instead of walking them through every technical step you have taken, you can simply explain the logic you are following. If your logic is sound, they can focus on helping you with the technical implementation, and even if your logic needs some fine-tuning, it will be much easier for them to spot where things might have gone wrong. Well, that was quite a detour!). Whether you are working in Tableau Prep, Alteryx, SQL, or Python, the underlying problem remains the same, even if the methods of solving it differ.
After all, knowing how to use a tool and knowing how to solve a problem are two different skills. The former is incredibly useful, but without the latter, you might simply become very efficient at going in the wrong direction. So, before opening Tableau Prep, Alteryx, or your SQL editor, grab a piece of paper, understand your input, examine your expected output, and sketch out how you might get there.
Plan first. Get your hands dirty second. And if you are taking the NYC subway, please keep a tap on your tap!
Further reading: If you are interested in learning more about this approach, I highly recommend reading Carl Allchin's How to… Plan your Prep on the Preppin’ Data blog. It provides a practical framework for planning your data preparation process and serves as an excellent starting point for exploring specific data preparation techniques in greater detail.
