Sometimes It Has To Be a Special Order ... Block Until Done
Roland Schubert
Entscheidungs- und ergebnisorienierte Datenanalyse für Finance, Marketing & HR - Von der Strategie bis zur Umsetzung | Planungs- und Analyseprozesse effizient gestalten, optimieren und automatisieren | Alteryx ACE
The sequence of tools in the workflow determines the order of execution. In this example, data is read from a file, processed and finally the result is written to an output file.
In this example we have sales per customer, product, sales representative and day for two years. In our report, we want to compare the two years per customer, so we create the corresponding totals and then write them to the Excel file.
But what to do if we need a comparison not only for customers, but also for product and sales representatives? And all three resulting tables should be on the first sheet of our Excel workbook as an overview sheet?
Okay, let's just make the appropriate totals and write in the areas reserved on the sheet for each table. However, we are creating a problem with this. The steps after Dynamic Rename can be executed in parallel, the result is that parallel writing to the Excel file can occur.?
And a simultaneous write access leads to an error.
To prevent this, we need to make sure that these steps are not executed in parallel, but one after the other.?
We can achieve this by adding a Block Until Done tool. This tool has one input anchor and three output anchors that are numbered. The steps associated with the output anchors are then executed in the given order, first the complete branch connected to output anchor 1, then the one connected to anchor 2, finally the one connected to anchor 3.
领英推荐
This way we have resolved the "competition" between the writing processes and put them in an order.
But - what can we do if more actions are needed? Unfortunately, there is no possibility to add more output anchors.
In the not so unlikely case that our report is to be sent automatically by mail afterwards, or in the even highly probable case that further tables are to be added to the file, three output anchors are not enough.
Now, we can "cascade", that is, insert another Block Until Done tool that first separates into the two areas "Sum and Write" and "Send Email". The first area (which we had before) is then separated into individual steps again.
So first everything behind the yellow (1) is executed, in the order given by the Block Until Done tool highlighted in red. Then, the step behind the yellow (2) follows.
Of course, this could be extended even further, i.e. additional branches could be added.