Filling Down in Alteryx

A lot of the time, data will have hierarchical fields, e.g. category and sub-category. When people are building these as a spreadsheet, often they don't want to type/paste the category in for every row, so they'll just write it once at the top and specify all their sub-category values in a separate field.

This is easy enough for a human being to read, but when we load it into Alteryx or Tableau, it'll look something like this:

Unlike a human, our software doesn't know that File is in the Tools category; it thinks it's in the Null category. Not helpful!

To fix this, we need to fill down the rows, so that File and Pliers have Tool next to them under Category, and the same for Gloves and Hard Hat with Gear as their Category. But how do we do this in Alteryx?

The Multi-Row Formula tool in Alteryx

If you're not sure how the Multi-Row Formula tool works, you can check out this blog I wrote on the logic and syntax. But assuming you have a basic understanding of how this tool works, let me explain how we're going to use it in this instance.

The Multi-Row Formula tool will compute whatever logic you write going down the rows starting from row 1, which allows us to compare values between rows. So let's talk out what logic we actually need, in simple English. When Category is Null, we want our Category to be the same as the Category value of the previous row. However, when Category is NOT Null, we want to keep that Category value.

In Alteryx, we can write that as:

IF isNull([Category])
THEN [Row-1:Category]
ELSE [Category]
ENDIF

And voila, your rows will be beautifully filled down, with only a few simple lines of code!

Author:
Freya Marijatta
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab