Smashing
Smashing

Reputation: 39

Displaying only 1 row for duplicated data in tableau table

I have a table that displays 8 columns. Due to the way the data source is structured (I cannot change this) it sometimes means one or more of the columns will be the same across two rows.

I need to filter to show only one row of data. This is based on "email', so if an email has more than 1 row, I want one of the rows. If the other columns are the same or not doesn't matter.

I don't need to combine anything, and I don't care which row is displayed, I just need to remove one of the duplicated rows.

Replace this:

Place    orderid    email    item    name    date
a        1          [email protected]  b       c       1/1/11
a        1          [email protected]  d       c       1/1/11

With this:

Place    orderid    email    item    name    date
a        1          [email protected]  b       c       1/1/11

Or this:

Place    orderid    email    item    name    date
a        1          [email protected]  d       c       1/1/11

Any help would be much appreciated! I had a go with LOD calculations and I couldn't make that do what I wanted (that may well be me not understanding how to use them properly, though).

Upvotes: 0

Views: 6864

Answers (2)

Patrick Ng
Patrick Ng

Reputation: 76

If you want to show the first row per email, regardless of what's in the other fields, try the following:

  1. Create an [Index] calc field using INDEX().
  2. Add [Index] to rows shelf and change to discrete.
  3. Edit the table calc for [Index], select 'Specific Dimensions' and restarting every email (dropdown menu). All of the checkboxes should be ticked by default.
  4. Notice how the index is not restarting for each email as expected. To correct this, drag email checkbox to the top position.
  5. From here, filter [Index] = 1 and hide index column from view.

Upvotes: 0

Bernardo
Bernardo

Reputation: 3318

Given your example, it appears the difference is within the [item] field. You can create an index calculation on it and filter for value of 1.

index()

Set the index to discrete and compute using the [item] and filter for only 1. You can hide the field if you don't want it to appear by deselecting Show Header.

enter image description here

Upvotes: 2

Related Questions