I have a macro that takes raw data from several sources and transforms it into a number of cleansed tables. This macro should happen first and I then want to call a number of different 'test' macros, each of which uses some of the outputs from the initial preparation macro. At the moment, each different 'test' macro is being treated individually, meaning the preparation macro is being run for each different 'test' macro - obviously this is very inefficient as the same transformation work is being done every time.
Is there a way to set up a single workflow that runs the preparation macro once at the start, then calls each of the test macros afterwards? I suppose I could output the preparation macro tables to actual files then read these back in for each test macro, but it feels inelegant, and breaks up the idea of a single workflow into one prep workflow and one test workflow. Also, I am not sure I can set up a file input when the file doesn't actually exist until the preparation macro is run (this should be a stand-alone end-to-end process)
Cheers
Solved! Go to Solution.
Hi @johnyarham
Could you please send a screenshot of how you have the macros linked up currently?
Best,
Jordan Barker
Solutions Consultant
Hi Jordan,
I have now reacquired access so have some screenshots to share, which will hopefully clarify my issue.
The main macro being called is this one. This calls a number of separate Test macros and outputs the results of each to Excel files.
Each of these test macros looks similar to the example below. They all call the same pre-processing/transformation macro to begin with then perform various edits and output the results for the overview macro above to use.
The standard pre-processing/transformation macro used by each Test macro looks like the below. There are 3 import macros called to start with to get the raw data, then some transformations are applied, with a number of outputs created. These are then used as required by each test.
Currently therefore, when I run the top macro, the entire import/transformation step is performed for each Test macro called. This is obviously unnecessary as the preprocessing/transformation part could be done once then each test macro run using the outputs. Is there a way to do this other than by having either an enormous workflow, or by somehow outputting the transformed data to text files which are then read in by each separate test macro (assuming I can add a hold to the macro that ensure the pre-processing completes before any tests...)?
Many thanks
Hi @johnyarham
I think adding text outputs would be a good solution. I have seen in the past calling upon certain macros within a workflow (test macros) based on the name of a input files (text outputs).
I have uploaded a sample workflow to dropbox which shows how to call upon macro based on the name of the outfile file and pass that into the appropriate macro within a workflow.
To ensure these are completed before passing the data on you could look to use the events tab to run one module after another.
Best,
Jordan Barker
Hi Jordan,
Thanks! I will look at setting the workflow up like this and see how I get on.
Cheers