I have a requirement to execute the daily workflow for last month. it should do it iteratively for each day and aggregate the data in the final output file. It should pass one date and let the workflow execute and then reduce the date by 1 and repeat. Can I use any calculation instead of using a macro?
Thanks in advance for your valuable time!
Solved! Go to Solution.
One way to do it is to generate the previous 31 dates using the row generate tool and pass it through batch macro.
It may be possible without macro it totally depends on the logic you are applying.
You can generate dates list using generate rows tool like below.
Workflow:
And pass them as groupby into the batch macro.
Here is a resource on batch macro
https://community.alteryx.com/t5/Interactive-Lessons/Creating-a-Batch-Macro/ta-p/657923
Hope this helps : )
Depending on your workflow, you can probably do it without a macro.
- Use a Generate Rows tool to duplicate your workflow once for every as-of date
- include the as-of field as a key in all your Summary, Join, Sort, Multi-row tools and any other place there is a Group by option
- Replace any Append Fields tools with Join tools keyed on as-of unless you're appending fields that apply to all as-of dates
Run the converted workflow with just the original as-of date, i.e. setup the Generate tools with a start of 1 and finish of 1. Check the results against your original. Then add 1 more date and check your results. Once this is working run for the whole month
Dan
Dan
Thank you...I'm getting the below error.
please check the below formula is there a variable rowcount if yes please replace it accordingly.
Hope this helps : )
I got that much part figured out. Thank you..Now how do I use the batch macro to feed all these dates into my workflow 1 by 1?
Can share me a snapshot of the workflow and tell me where exactly is the date being switched.
There are bunch of dates in this formula tool which use DateTimeToday() to calculate the dates which are being fed down in the logic. The DateTimeToday() needs to be iteratively replaced by individual date of the month.
2) The output is obviously 1 file for one date. The logic needs to be changed so that it has the data for 30 days 🙂
Refer to this interactive lessons modifying expression part. That should help.
https://community.alteryx.com/t5/Interactive-Lessons/Creating-a-Batch-Macro/ta-p/657923#done
If you are facing any issues let me know.