Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

If then statement to choose one row over another based on multiple criteria

Jholiday78
7 - Meteor

Greetings,

 

I need a solution to remove duplicates based on the criteria below. 

 

If [Dep_Tran_Date] = [Balance_SnapshotDt] then [Dep_Tran_Date] = [Balance_SnapshotDt] Else [Previousday] = [Balance_SnapshotDt] ENDIF

 

Basically I want my workflow to choose the row that the [Dep_Tran_Date] = [Balance_SnapshotDt].  If it doesn't match, then choose this line where the [Previousday] = [Balance_SnapshotDt].

 

I think my workflow is doing this, however, it is also removing rows that are not duplicates. I added a record # to track the changes.  In the Final Out browse node lines 11,12,13 are missing.  They were not duplicates based on the criteria above.  The were individual transactions where the DEP_Tran_Date and Balance_SnapshotDT  were equal.

 

Any help would be appreciated.  Thank you!

 

 

2 REPLIES 2
AngelosPachis
16 - Nebula

Hi @Jholiday78 ,

 

I struggled to understand the logic a bit or why Record13 should be included, but here's a workflow that probably does what you're looking for?

 

AngelosPachis_0-1653257515781.png

First it keeps al records that satisfy the first condition ([Dep_Tran_Date] = [Balance_SnapshotDt] ) else if there's a [Dep_Tran_Date] that didn't satisfy the first condition then we keep the records that satisfy the second condition ( [Previousday] = [Balance_SnapshotDt] )

 

Hope that helps,

Angelos

 

Jholiday78
7 - Meteor

Thank you!  This worked perfectly.  And sorry to confuse you, yes, record 13 shouldn't have been including according to my logic.  I've been staring at this workflow too long.

Labels
Top Solution Authors