Data Analytics | Data Visualization | Insights

How To Remove Duplicate Values in Tableau Prep

One feature of tableau prep is the ability to help with data cleansing. Data cleansing is the process of detecting and correcting (or removing) corrupt or inaccurate records from a dataset, table, or database and refers to identifying incomplete, incorrect, inaccurate, or irrelevant parts of the data and then replacing, modifying, or deleting the dirty or coarse data. There are times when you want your dataset to only have unique values. In this example, we are going to use Tableau Prep to create a dataset that only has one record per customer. We would typically use this as a dimension/lookup table in our data model.

Option 1: Aggregate 

We can use the built-in aggregate functionality to remove duplicates. By default, Tableau prep will remove duplicate values when you use group by

We have connected to the superstore dataset and removed the unnecessary columns. We now have a dataset that contains Customer ID and Customer Name. In this example, you can see that there are several customers with multiple rows in the dataset.

Next we will add an Aggregate step to the workflow and add Customer ID and Customer Name to the Grouped Field section. We will now see that we have one record per customer.

To test this out I’ve filtered Claire Gute and we can see only one record for this customer.

Option 2: Create a unique rank and filter out results


In this example, we will walk through removing records based on the latest order date. In our dataset, we have the order date, customer id, and customer name.

Next, we are going to create a calculated field and create a ID using the partition, order by, and Row Number functionality. We partitioned by Customer ID because we want our counts to reset after each new customer id. We ordered by order date DESC because want the id to be based on the latest date (if we wanted this to be based on the earliest date then we would use ASC)

We now have a unique ID for each record in sequential order for each customer.

Next we will filter our calculated field to only keep 1.

Now we will remove Rank and Order from our dataset and we will have a finished dataset with only unique values.

Tableau Prep can be a powerful tool that can save you a lot of time in preparing your data to visualize. I love helping clients understand their data at a new level through the art and science of data visualization. To learn more about how I and Lovelytics help clients do more with their data, please visit us at www.lovelytics.com or connect with us by email at [email protected].

Author

Related Posts

practical guide for leaders who need a clear plan for stronger governance in 2026
Dec 09 2025

10 Steps to Updating Your 2026 Data Governance Strategy

It is the holiday season and organizations are preparing to accelerate their new budgets and plans for 2026. With the desire to drive AI use cases and further enable...
Oct 09 2025

Gridlytics AI: Transforming Utility Grid Operations with Unified Ontology and Interpretive AI

As the energy landscape rapidly evolves, utilities face unprecedented challenges. Aging grid infrastructure, decentralized renewables, surging demand from electric...
Oct 01 2025

Accelerating Innovation: Philadelphia Union’s Data-Driven Journey to Dominance

Driven by Data, United for Victory In the high-stakes world of professional sports, every detail can make or break success. The Philadelphia Union, a formidable force...
Sep 18 2025

Deploying an AI Governance Council Actually Improves Innovation

Throughout my career, I've frequently encountered the notion that governance impedes innovation. However, in practice, the reality is quite the opposite. The rapid...
Aug 27 2025

Why “Data as a Product” Is the Shift Business Leaders Need Now

Most companies don’t have a data problem. They have a data usability problem. You have data. Lots of it. But when it’s time to make a business decision, whether it’s...
Aug 22 2025

It Is Time for Every Organization to Embrace AI Governance

AI or Artificial Intelligence is no longer a concept from sci-fi movies. It is now a full reality that is embedded in how businesses operate, make decisions, and engage...
Aug 04 2025

How Lovelytics and Databricks Partnered to Migrate and Automate Databricks’ Internal Reporting to AI/BI

Introduction: What is AI/BI and Why It’s a Game-Changer For years, BI tools have helped organizations analyze and visualize data, but the landscape has shifted....
Jul 31 2025

Announcing the Geospatial AI Accelerator, Our Latest Brickbuilder 

Built on Databricks to unlock AI-driven insights from geospatial data We’re excited to announce the launch of the Geospatial AI Accelerator by Lovelytics, our latest...
Jul 31 2025

Agentic AI: Building Secure, Ethical, and Governed AI Agents 

A practical guide for business and technology leaders Introduction: When AI Acts Autonomously, Can You Trust It? AI agents capable of independent decision-making...
Jul 23 2025

Why Data Literacy Is Critical to Enable a Data-Driven Culture

In the age of digital transformation, nearly every organization I have encountered in practice has expressed a desire to be “data-driven”. But there's a critical...