<?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: Using Calculate Value with Table Iterator in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766492#M3169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That has fixed it. I thank you profusely Riyas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Sep 2014 14:53:50 GMT</pubDate>
    <dc:creator>PeninahMurage</dc:creator>
    <dc:date>2014-09-12T14:53:50Z</dc:date>
    <item>
      <title>Using Calculate Value with Table Iterator</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766490#M3167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it also possible&amp;nbsp; to use Calculate Value with the Table Iterator? I have 9000 tables each with a column name that needs altering. So for example, all the tables have a column called 'Rastervalu', I would like to change this name for each column to represent a unique value which is the table name. So again in first table 'RasterValu' will be called 'GP-CodeA82010'. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I am hoping to eventually join these tables to a master table. Using model builder I would like to truncate/drop the 'GP_Code' part of the name and leave the name as 'A82010' and so forth. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am very new to Python but have tried different expressions as follows;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Right([FieldName], 6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; line-height: 107%; font-family: 'Arial','sans-serif'; font-size: 10.5pt; mso-bidi-font-weight: bold;"&gt;"%Name%"[7:13]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;"%Name%".replace("GP_Code","")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the Calculate Value model only tool does not appear to do the job, so instead of slicing the 'GP_Code' bit inorder to give me the reduced name, it is giving me a value of 1 (see attached image)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas of what I might be doing wrong? or what script I should be using?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Penny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 21:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766490#M3167</guid>
      <dc:creator>PeninahMurage</dc:creator>
      <dc:date>2014-09-11T21:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Calculate Value with Table Iterator</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766491#M3168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peninah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: Arial, sans-serif;"&gt;"%Name%".replace("GP_Code",""), &lt;/STRONG&gt;&lt;SPAN style="font-family: Arial, sans-serif;"&gt;should have worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial, sans-serif;"&gt;The thick line between your name and calculate value tells me, you are passing Name as expression and placed the code in code block. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial, sans-serif;"&gt;You want to have your calculate value expression as shown in image below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial, sans-serif;"&gt;Also note the doted line, it means having value for Name parameter is a precondition for Calculate Value to execute and is not passed as expression to the tool. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial, sans-serif;"&gt;Name parameter can be accessed across the model as %Name%, you don't have to pass it explicitly to the tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial, sans-serif;"&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/9654_Untitled.png" style="width: 620px; height: 496px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 04:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766491#M3168</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-09-12T04:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Calculate Value with Table Iterator</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766492#M3169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That has fixed it. I thank you profusely Riyas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2014 14:53:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/using-calculate-value-with-table-iterator/m-p/766492#M3169</guid>
      <dc:creator>PeninahMurage</dc:creator>
      <dc:date>2014-09-12T14:53:50Z</dc:date>
    </item>
  </channel>
</rss>

