ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Selecting Records based on date Difference

LorenzTaylor
Asteroide

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 RESPUESTAS 2
TheMattLeonard
Asteroide

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
Asteroide

Thanks! This was extremely helpful.

Etiquetas
Autores con mayor cantidad de soluciones