community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

If statement

Hi All,

 

I am new user of Alteryx and I would like to solve not so complicated problem.

I have table with multiple dates for each id, sometimes is one date sometimes its 10 or more.

I would like to take second last date that occurs in the table or if there is only one for such id use this one.

I still have to learn how to manage dates values in alteryx, so this simple problem is complicated for me.

Could you help me?

Alteryx
Alteryx

I'd probably do the following

 

  • Sort the data by Date (descending)
  • Use Sample tool to select the First 2 and Group by ID - this will give you the last and the second last date
  • Use Summarize to group the data by ID and select Min Date which will give you the second last date only

second-last.png

Asteroid

Here is a solution using the running total and formula tools to identify the second to last dates if there are multiple dates to an ID. Workflow attached.

Capture.JPG

Labels