All Collections
Tips & Tricks
How to Automatically Fill in Missing Values in a Dataset πŸ’‘
How to Automatically Fill in Missing Values in a Dataset πŸ’‘

Learn how to automatically fill in missing data in a dataset using the LAST() function in the expression builder of a Transform tool.

Updated over a week ago

Introduction

Have you ever found yourself with incomplete or incorrect data in a dataset? It can be frustrating, especially when you need to analyze or report on that data. Fortunately, there are tools available to help you quickly and easily fill in missing values. In this guide, we'll walk you through one such tool: the LAST() function in the expression builder of a Transform tool.

Identifying Missing Values

Before we can fill in missing values, we need to identify where they are in our dataset. In our example, we want to fill in the missing value for "Customer Name". We can see from the screenshot that this value is missing for the first row in the dataset.

Using LAST() to Fill in Missing Values

To fill in the missing value for "Customer Name", we'll use the LAST() function in the expression builder of a Transform tool. Here's how to configure it:

  1. Field name: Choose a name for the new field that will contain the filled-in values.

  2. Builder: Select "selected".

  3. Calculation: Choose "LAST".

  4. Use Aggregation Window: Check this box.

  5. From: Choose "Unbounded".

  6. To: Choose "Current Row".

  7. Partition: Leave this field blank.

  8. Argument: Select the field that contains the data you want to fill in (in our case, "Customer Name").

  9. Sort: Choose the field that you want to sort by (in our case, "CustomerID").

And that's it! The LAST() function will automatically fill in missing values based on the last non-missing value in the dataset.

Conclusion

Filling in missing values in a dataset can be a time-consuming and frustrating process, but tools like the LAST() function can make it much easier. By following the steps outlined in this guide, you can quickly and accurately fill in missing values and get back to analyzing your data.

Did this answer your question?