<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Looping a workflow through multiple files in Alteryx Designer Desktop Discussions</title>
    <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41473#M16019</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/10008"&gt;@Paul_L&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a workflow which contains the following elements which I think you'll need for&amp;nbsp;what you're trying to accomplish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Read in directory of filenames&lt;/P&gt;&lt;P&gt;2. User selects date and number of days&lt;/P&gt;&lt;P&gt;3. Generate rows to identify required filenames&lt;/P&gt;&lt;P&gt;4. Dynamic input to read in relevant files (NB.&amp;nbsp;&lt;EM&gt;Output File Name as field&lt;/EM&gt; has been configured in tool)&lt;/P&gt;&lt;P&gt;5. Perform&amp;nbsp;batch macro based on each file's data only (in this case calculating an average).&lt;/P&gt;&lt;P&gt;6. Outputting to different file names based on the values in a field by configuring output tool to &lt;EM&gt;Take File/Table Name from Field&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Edited response to include user input for date range)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2016 18:22:36 GMT</pubDate>
    <dc:creator>DataBlender</dc:creator>
    <dc:date>2016-12-19T18:22:36Z</dc:date>
    <item>
      <title>Looping a workflow through multiple files</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41444#M16017</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've a set of data files with a date prefix.&amp;nbsp; I'd like to process each file individually fully through a workflow (carrying out Market Basket Analysis) and then write out individual output files from the analysis along with the date prefix.&amp;nbsp; My ideal user input would be a start date and number of days (e.g. 30/10/2016 and 4).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen various bits of generic advice referencing iterative macros, dynamic inputs and batch macros, but none seem to cover it.&amp;nbsp; I feel like it should be straightforward, but I'm struggling to achieve it.&amp;nbsp; The files will be very large, so I need to process each file individually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example filenames:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;30_10_2016_inputs&lt;/P&gt;&lt;P&gt;31_10_2016_inputs&lt;/P&gt;&lt;P&gt;01_11_2016_inputs&lt;/P&gt;&lt;P&gt;02_11_2016_inputs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each file will contain many rows of items along with their corresponding order ID to run through the inbuilt Market Basket Analysis R tool. &amp;nbsp;I want to export the rules from the MB Inspect tool to files named:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;30_10_2016_output&lt;/P&gt;&lt;P&gt;31_10_2016_output&lt;/P&gt;&lt;P&gt;01_11_2016_output&lt;/P&gt;&lt;P&gt;02_11_2016_output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 02:40:53 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41444#M16017</guid>
      <dc:creator>Paul_L</dc:creator>
      <dc:date>2018-05-24T02:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Looping a workflow through multiple files</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41468#M16018</link>
      <description>&lt;P&gt;Forgot to say, I'd also be happy for a single output file with a column containing the date, but I suspect that's harder to achieve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help gratefully received,&lt;/P&gt;&lt;P&gt;Thanks Paul&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 16:57:30 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41468#M16018</guid>
      <dc:creator>Paul_L</dc:creator>
      <dc:date>2016-12-19T16:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Looping a workflow through multiple files</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41473#M16019</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/10008"&gt;@Paul_L&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a workflow which contains the following elements which I think you'll need for&amp;nbsp;what you're trying to accomplish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Read in directory of filenames&lt;/P&gt;&lt;P&gt;2. User selects date and number of days&lt;/P&gt;&lt;P&gt;3. Generate rows to identify required filenames&lt;/P&gt;&lt;P&gt;4. Dynamic input to read in relevant files (NB.&amp;nbsp;&lt;EM&gt;Output File Name as field&lt;/EM&gt; has been configured in tool)&lt;/P&gt;&lt;P&gt;5. Perform&amp;nbsp;batch macro based on each file's data only (in this case calculating an average).&lt;/P&gt;&lt;P&gt;6. Outputting to different file names based on the values in a field by configuring output tool to &lt;EM&gt;Take File/Table Name from Field&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Edited response to include user input for date range)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 18:22:36 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41473#M16019</guid>
      <dc:creator>DataBlender</dc:creator>
      <dc:date>2016-12-19T18:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Looping a workflow through multiple files</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41573#M16020</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/5127" target="_self"&gt;&lt;SPAN&gt;DataBlender&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help, really appreciate it.&amp;nbsp; In the end I found what appears to be a simpler solution as it does not need a dynamic input.&amp;nbsp; After the Generate Rows tool, I placed a formula tool to&amp;nbsp;create the full filepaths of the input and output files, appended with the dynamic elements:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\"+DateTimeFormat([Date],"%Y_%m_%d")+"_input.csv"&amp;nbsp;&amp;amp; \"+DateTimeFormat([Date],"%Y_%m_%d")+"_output.csv"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then placed my full workflow for the market basket analysis inside a batch macro and used a control parameter along with action tools (update input data tool &amp;amp; update output data tool) to update the input and output files for each iteration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the inputting and outputting of the files are within the batch macro there's no need to pass the filename through the workflow which simplifies things massively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 16:49:37 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/41573#M16020</guid>
      <dc:creator>Paul_L</dc:creator>
      <dc:date>2016-12-20T16:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Looping a workflow through multiple files</title>
      <link>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/85115#M16021</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm am trying to do something similar. Would you be able to post your workflow and macro? Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 17:52:24 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Looping-a-workflow-through-multiple-files/m-p/85115#M16021</guid>
      <dc:creator>ckestler</dc:creator>
      <dc:date>2017-10-06T17:52:24Z</dc:date>
    </item>
  </channel>
</rss>

