Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Remove duplicate values in a column based on date in another column

johnsa64
5 - Atom

I have a fee that is charged once a month. I am trying to have the fee only show up one time in a month, then have the rest of the cells blank. 

johnsa64_0-1660757488220.png

Here is what I have right now. 


I'm also very new to Alteryx so if you have a solution, please don't leave out anything you may think is obvious, because I am still learning. :) 

Thank you! 

5 REPLIES 5
DataNath
17 - Castor

@johnsa64 if you bring on a Unique tool and tick [Invoice Month] under 'Columns' in the configuration, that ought to get you what you want. The unique tool basically just looks for the first instance of each unique value in the selected field (or first unique combination if selecting multiple fields), then discards everything else as duplicates (these come out of the bottom (D) anchor. What you want should come out of the top (U) anchor. Here's a small example:

 

Before:

DataNath_1-1660758145449.png

 

After:

DataNath_0-1660758130965.png

kathleenmonks
Alteryx
Alteryx

Hi @johnsa64,

 

If you are ok with removing the other rows, then @DataNath solution will solve your problem. If you wish to keep those rows, then you can union your results back together and keep the rows that aren't unique. See my attached workflow and screenshot. I have added an ID column just to replicate your other columns and the fact that they may have different data (ex. Trans_ID)

 

uniqque.PNG

DataNath
17 - Castor

Good call @kathleenmonks - had overlooked that they only wanted to 'blank' duplicates, rather than remove the entire rows! For that, I'd just use a Multi-Row Formula though, based on the changing month:

 

In @johnsa64's case, the Multi-Row Formula would be set to update existing field (Gatekeeper Fee) & the expression would be:

if [Invoice Month]=[Row-1:Invoice Month] then null() else [Gatekeeper Fee] endif

 

For the sake of explanation, all this is saying is: If the Invoice Month in the current row is the same as the one in the previous row, null that value. If not, show it.

 

DataNath_0-1660758858947.png

DataNath_1-1660758867357.png

 

kathleenmonks
Alteryx
Alteryx

@DataNath nice! Much more streamlined approach. I saw "unique" and got tunnel vision. 

johnsa64
5 - Atom

This worked and my output in Alteryx looked right.

However, now I am having an issue in Tableau where its only populating SOME of the unique values.  Its odd.

 

January, February and May populate

March, April, June do not.

 

I know this isn't the same program, so I will keep after it. Thank you!

Labels