Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to choose the program(s) with closest date from today?

Mert
Alteryx
Alteryx

Hi. My data is about a group of workshop programs to be delivered during 2024.

 

Data has 3 regions: America, Asia and Europe.

 

There are 4 different workshop programs: A, B, C and D. 

 

Each program is delivered over 3, 4 or 5 days, and is repeated multiple times during the year for convenience.

 

For Example:

 

RegionProgram

Session

Date

Program Start DateProgram End Date
AMERICAB05/08/202405/08/202415/08/2024
AMERICAB08/08/202405/08/202415/08/2024
AMERICAB12/08/202405/08/202415/08/2024

 

In the table above, program B has 3 sessions delivered in 3 dates which are close to each other.

 

I would like to create a table like below:

 

 ABCD
AMERICA    
ASIA    
EUROPE    

 

In empty cells, I would like to put dates from Program Start Date field and it should be the start date of the closest program from today.

 

I attach sample data with an additional field Program Start Date From Today. I will be thankful if anyone could help me with the workflow. TIA!  

4 REPLIES 4
DataNath
17 - Castor
17 - Castor

Hey @Mert, how does this look? After an ascending sort on the time differential from today, we can Cross-Tab the results. We group by [Region], using the [Program] as the new field headers and then for the aggregation just take the first value i.e. the lowest in the sort:

 

tuv.png

CoG
14 - Magnetar

Will your data always only have upcoming events? If so, I agree with @DataNath 's simple and elegant solution. Otherwise, if historical events are also present, you will want to filter them out before the Sort and Cross Tab Tools.

DataNath
17 - Castor
17 - Castor

Good catch @CoG - hadn't considered negative time differentials!

Mert
Alteryx
Alteryx

@DataNath - Thank you very much for your quick help with a spot on solution 😊

 

@CoG - Thank you for the heads-up for the negative dates. I had shared the part of the workflow where I got stuck, only. In the wider workflow, exactly like your warning, I first filter out the sessions which were already delivered.

 

Have a nice Sunday both 🙌

Labels
Top Solution Authors