Hello,
I have a workflow which compute a table results.
I will execute this workflow daily (or weekly, or monthly).
I need to write the new computed results, merging it with the previous ones already written into a file.
It's not just an "append" to do, as the previous execution and the current one, may have overlap results.
So basically, I need to
- read the existing results file
- compute the new result (it's independant from reading the previous results).
- merge / join both results tables
** On left output of the join, I will have all previous results not in current ones
** On right output of the join, I will have all new results
** In middle output, it's the duplicated results
- then write left + middle + right to the file (overwritte the file).
This is working well... if I already have an existing file.
But at the first execution, it bug as there is no existing file to feed the input/read module.
How can I acheive this?
Regards,
Alex
@Bargeton
Ok, here is one way; use a batch macro.
First, use the Directory tool to see if the file exists.
Then let the macro decide which Container to destroy.
I've attached the two CSV files for the proof of concept. Put them somewhere and play with removing and returning the test.csv file.
I thought of a way to do this in the R tool. If you want that, say something in the comments.
David
can u share the macro file
@shadrachreddy !
Just download the New Workflow1.yxzp and the two CSVs . Double click on the yxzp file and you'll get the files. Right-click the macro in New Workflow1.YXMD and open it up.
Best,
David