In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. 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

Find Min from a Dynamic Number of Fields

kaianderson
8 - Asteroid

I have a series of fields, "Date_Product1", "Date_Product2", "Date_Product3" etc. The number of these fields varies (needs to be able to handle 10 or 30 product fields). They each have a purchase date in them. I need to create a "First Product" field that pulls in the field name with the earliest date, whose calculation method can handle a changing number of fields.

 

Any ideas?

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

The easiest way to do this would be to:

 

2018-12-27_22-46-37.png

 

1. transpose the data keeping the User as a Key field

2. Sort by User and Value

3. Sample the first for each user

4. Join back to input

 

Sample attached

kaianderson
8 - Asteroid

Thank you so much! I had no idea that you could group on a sample tool. That was a huge help.

 

I was able to get this to work after inserting a filter between the sort and the sample tools to filter out records with null Value fields. Works like a charm!

Labels
Top Solution Authors