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.
SOLVED

Finding First, most recent, and previous

jcoleman13
6 - Meteoroid

Hello, 

I am trying to take a dataset with IDs, amounts, and dates and find the first, most recent, and previous amounts.  I order by the ID, and the date, and then summarize to get the first and last (most recent), but how do I get the previous... meaning the value before the most recent.  For Instance, ID 8 has 4 different amounts and dates, I want to the first, the last and the one right before the last.  Is there any way to do that that I am missing?

 

Data:

ID

AmountDate
1

$50

1/1
1$251/15
1$1002/1
3$202/18
3$503/4
4$203/9
5$45/15

8

$106/15
7$157/1
8$308/2
7$209/2
8$2010/15
8$10011/25

 

What I want to see:

IDFirst AmountMost Recent AmountPrevious Amount
1$50$100$25
3$20$50$20
4$20$20$20
5$4$4$4
7$15$20$15
8$10$100$20

 

Thanks!

2 REPLIES 2
jrlindem
12 - Quasar

Here's an example workflow that solves your problem.  The only thing I didn't do was reformat your numbers back to include the dollar sign, but a simple formula should take care of that for you.

 

Here's the workflow (also attached):

 

jrlindem_0-1764707310344.png



Hope this helps you along your way.  Cheers, -Jay

jcoleman13
6 - Meteoroid

Thank you!!!

Labels
Top Solution Authors