Alteryx Designer Desktop Discussions

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

Rerun Workflow on Condition

Verenala4
8 - Asteroid

Hi everyone!

 

I have a kind of odd question. 

 

Background: my team has a team building activity each week which one person has to lead. This is usually selected randomly. However, I thought it would be nice to have an alteryx workflow that runs every week and randomly selects one member of the team and notifies this person by email. 

 

I got the "random selection" part but now I can't figure out a way to basically tell my alteryx workflow to "restart/rerun" if the random selection matches the top 5 people from before. Basically, I want to prevent the same person being selected every other week.

 

Is there a way to do this?

 

Below is my workflow:
Capture.PNG

 

 

 

 

 

 

Thank you,

V

3 REPLIES 3
afv2688
16 - Nebula
16 - Nebula

Hello @Verenala4 ,

 

Here is my idea:

 

Why don't you add to your workflow a colum that adds +1 every time one person is selected? So you can keep a ledger of every time a person has been selected.

 

Scheming it would be:

 

Take list -> sort by column [Times one has been selected]

             -> sample and take top 5 out

             -> do random selection with the rest

             -> notify the person by mail

             -> add +1 to [Times one has been selected] 

             -> replace the value on the table

 

What do you think about it?

 

Cheers

ChrisTX
15 - Aurora

Instead of trying to re-run if the workflow selects a recent top 5 person from your history table, try removing the most recent 5 people from the Input table at the beginning.

 

At the start of your workflow...Take your Past Team Leaders, sort by date descending, use Sample tool to skip the first 5 records, use the Join tool (left anchor = your Input Names table, right anchor = your History table with top 5 removed) and continue processing with the Left anchor from the Join.

 

Verenala4
8 - Asteroid

Thank you @afv2688 and @ChrisTX for both of your answers!

 

I ended up using @afv2688's solution just because it was there first but I am sure the other one works just as well. I liked the idea of adding the column with the times they have been selected and overwriting this result in the original table at the end of the workflow.

 

I also added Report Text tool to create a custom formatted "Email Body" and an Email Tool so the people are directly notified and it works great.

 

Thank you both for your input!

Labels