<?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: Creating a table from values and export it in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1042423#M625</link>
    <description>&lt;P&gt;This can be done by creating a table, adding fields, and adding data using a cursor. The easiest way is to do this in Python using the Calculate Value tool.&lt;/P&gt;&lt;P&gt;However, if you are in a hurry, you can use the Calculate Value tool to just spit out the values in to the messages stream, use the expression (the things in % are all model variables, %n% is a built in one that counts loops though you could use any model variable to identify results):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"Result {}: {} {} {}".format(%n%, %zscore%, %index%, %pvalue%)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then copy and paste the messages stream into a text editor and clean it up to make a csv to load into excel. Sometimes brute force is easier than writing a bunch of code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; I fixed up the expression above and added another variable to identify the results for each loop.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Apr 2021 14:28:40 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-04-20T14:28:40Z</dc:date>
    <item>
      <title>Creating a table from values and export it</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1042313#M624</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m trying to apply the Spatial Autocorrelation (Global Moran´s I) Tool for a big dataset. It contains values on a county level of several days. I want to generate an output file (e.g., excel/csv), that holds the scores produced by the Spatial Autocorrelation Tool for each individual day.&lt;/P&gt;&lt;P&gt;So far, I´ve managed to build an iteration loop for my fields, that are used as the input to the Spatial Autocorrelation Tool. When running my built model, it will output the Report files for all my cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;How can I combine the output (ZScore, Index, PValue) into one table file? I want the values from my iteration to be the column name and the values from the Spatial Autocorrelation Tool to be the data in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimHaas_0-1617184250696.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/9733iEE830195767F843D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimHaas_0-1617184250696.png" alt="TimHaas_0-1617184250696.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 09:52:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1042313#M624</guid>
      <dc:creator>TimHaas</dc:creator>
      <dc:date>2021-03-31T09:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table from values and export it</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1042423#M625</link>
      <description>&lt;P&gt;This can be done by creating a table, adding fields, and adding data using a cursor. The easiest way is to do this in Python using the Calculate Value tool.&lt;/P&gt;&lt;P&gt;However, if you are in a hurry, you can use the Calculate Value tool to just spit out the values in to the messages stream, use the expression (the things in % are all model variables, %n% is a built in one that counts loops though you could use any model variable to identify results):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"Result {}: {} {} {}".format(%n%, %zscore%, %index%, %pvalue%)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then copy and paste the messages stream into a text editor and clean it up to make a csv to load into excel. Sometimes brute force is easier than writing a bunch of code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; I fixed up the expression above and added another variable to identify the results for each loop.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 14:28:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1042423#M625</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-04-20T14:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table from values and export it</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1048647#M626</link>
      <description>&lt;P&gt;Thank you for the answer. I´ve tried out both solutions.&lt;/P&gt;&lt;P&gt;By creating a table, did you mean to create an excel file, give it the desired column names and then implement it into the ModelBuilder tool? At his point I was not able to connect it to the values created, as I barely have any knowledge on python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I approached the brute force way and it worked. From there I´ll try to clean the text up and extract my wanted information. Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One short follow up question: Is there a way to re-open the message stream once it has been colosed?&lt;/P&gt;&lt;P&gt;A note for everyone with the same problem, wanting to try out&amp;nbsp;curtvprice&lt;SPAN&gt; ´s solution: make sure to add the extra % after pvalue in the expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 09:05:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1048647#M626</guid>
      <dc:creator>TimHaas</dc:creator>
      <dc:date>2021-04-19T09:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table from values and export it</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1048699#M627</link>
      <description>No, the first solution was purely python based, where you write a python function with the calculate value tool to write the values from the tool output (I believe they are exposed as output parameters) using an arcpy cursor - pretty involved if you haven't used much Python yet, but not too difficult.&lt;BR /&gt;If you run the tool in model edit mode, no, you can't access the message stream, it's gone. However, if you run the model as a tool from the Geoprocessing pane, the messages are captured to the geoprocessing results window (ArcMap) or the geoprocessing history messages (ArcGIS Pro) so you can get them there.&lt;BR /&gt;Hope this helps you out!&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Apr 2021 13:17:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1048699#M627</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-04-19T13:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table from values and export it</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1049120#M628</link>
      <description>&lt;P&gt;Yes, it absolutely does. Thanks once again!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 14:19:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1049120#M628</guid>
      <dc:creator>TimHaas</dc:creator>
      <dc:date>2021-04-20T14:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table from values and export it</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1049123#M629</link>
      <description>&lt;P&gt;I fixed the bug (missing %) above, sorry about that. Please mark my answer as the solution to help others with the same question! (Honestly I don't care about the points but it helps people find answers!)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 14:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/creating-a-table-from-values-and-export-it/m-p/1049123#M629</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-04-20T14:24:55Z</dc:date>
    </item>
  </channel>
</rss>

