We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Setting timing delay within the workflow

lmaughan
7 - Meteor

I am working on an Alteryx process that I want to output different parts of the process to a single Excel file with multiple tabs.  Occasionally I run into timing issues where a tab can not be written to because of file locking issues.  I want to get around this issue by inserting a timing loop that will delay the process run for X number of seconds before continuing to the next step.

 

Is there an Alteryx tool that has this functionality?

 

Thanks in advance.

12 REPLIES 12
RolandSchubert
16 - Nebula
16 - Nebula

Hi @lmaughan ,

 

there is a CrewMacro named "Wait A Second" that could do the job. You also could consider using "Block Until Done".

 

Best,

 

Roland

lmaughan
7 - Meteor

Does the Wait a Second macro pause for X seconds between each data row calculation?  I added it to a flow that has ~2000 rows of data and without the Wait a Second macro, the process finishes in .8 seconds.  With the macro inserted, the process took 31 minutes to complete when the parameter was set to wait 1 second.

 

I am not sure how to connect the Block until Done to wait for one data stream to complete before writing out the second OUTPUT.

 

lmaughan_0-1603747819919.png

 

Can you clarify please?

Thanks!

echuong1
Alteryx Alumni (Retired)

The Block Until Done goes in your stream prior to your output tool. You can "chain" the block until done tools to further delay processing the output. Depending on your dataset sizes, you may not need one for the second output. Otherwise, you can add one to your bottom stream and chain as needed.

 

echuong1_0-1603808890023.png

 

The Wait a Second CREW macro will wait x seconds between each record it processes.

 

lmaughan
7 - Meteor

Do you know of an example where a chain is used only for the output?  There is only one input and in the example shown it looks like Wait Until Done will execute after the filter process is complete.  What I want is workflow process 1 to complete, write records to an Excel file -- then execute the output for workflow process 2.  The timing is in writing all records to an Excel file, then passing the process for the second process to write to another tab in that same Excel file.

 

There is not an output anchor on an output to Excel... and I need more than to wait on a tool within a single workflow process to complete.  If you are aware of any examples as mentioned above, I would love to explore further.

 

Thanks for your help!

 

CAJay
6 - Meteoroid

solution which I could think of using R tool, on Alteryx wait issue please find below

 

Basically 2 tools are being used to arrive at the solution –

Block until Done and R language Tool

 

Under Block until done tool

1st  Stage add R Language tool and run below script – (”30” in script means 30 seconds , which can be changed accordingly)

2nd Stage add the relevant tool needed as per your requirement

 

CAJay_0-1658226254486.png

 

CAJay_1-1658226254129.png

 

 

R Script below

 

testit <- function(x)

{

    p1 <- proc.time()

    Sys.sleep(x)

    proc.time() - p1 # The cpu usage should be negligible

}

testit(30)

aroumpelaki
8 - Asteroid

Hello all!

 

I had the exact same issue, and the Block Until Done tool works just fine!
In my case, I had all the data gathered with a join, the first two rows are the headers and the rest of the rows are the numeric data.

So, I added the Block Until Done tool just before splitting my data.

This way, the flow first picks the header data, and writes it to excel in text format.
When that is finished, it picks the rest of the rows, converts them to numeric, and appends them to the sheet.

 

Hope it helps :)

aroumpelaki_0-1665396341042.png

 

EdP
Alteryx
Alteryx

Additional suggestions can be found here:  

 

Ed Phelps
Sr CSE
Alteryx
AsmiDesai
9 - Comet

I was trying this logic of adding timer in workflow, a lot of good solutions here.

I referenced them to do it using Block until done + Python tool as I don't have R tool.

 

Here it is:

Timer.PNG

Python Lines:

 

from ayx import Alteryx
from datetime import datetime
import time
import psutil
def adpause(x):
   p1 = time.process_time()
   time.sleep(x)
   return time.process_time() - p1
current_time=datetime.now()
print("Timer starts at: " ,current_time)
result = adpause(60)
current_time=datetime.now()
print("Timer ends at: " ,current_time)

 

 

JPSeagull
8 - Asteroid

@echuong1 - I have been searching forever for a simple solution to forcing a pause in exporting multiple sheets. That Wait a Second CREW tool is PERFECT!!! Thank you for suggesting it. And I did catch the seconds delay between each record in the same output. I had initially thought it was x seconds between the next sheet/output so I had it staged as 60, 120, and 180 seconds... that took forever. Changed it to 1, 2 and 3 seconds which is plenty of time.

 

Thanks again!

Labels
Top Solution Authors