Alteryx Designer Desktop Discussions

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

Selecting Records based on date Difference

LorenzTaylor
7 - Meteor

Good Morning, 

I'm currently trying to filter records based on the "Date DIFF" grouped by The Car Initial and Number. There are Currently Multiple records for the same Car and I would like the formula/filter to reset after each Car Initial and Number. Please see attached for examples.

For example Car GATX 9272 has 5 records, each record has a different amount in the "Date Diff" Column. I would Like to select the records with the minimum Date difference, which in this case would be the row with "7" in the  "Date Diff" column.

2 REPLIES 2
TheMattLeonard
8 - Asteroid

You'll need a few tools to accomplish this.

 

First, use a Summarize tool. Select "Add-->Group By" for EQ_INIT and EQ_NR, and select "Add-->Min" for Date Diff.

 

Next, use a Join tool, with the original Datastream going into the left side of the join, and the Summarize tool you just created going into the right side. You're going to join on EQ_INIT and EQ_NR.

 

Finally, use a filter tool where your expression is [DATEDIFF] = [Min_DATEDIFF]

LorenzTaylor
7 - Meteor

Thanks! This was extremely helpful.

Labels