<?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: Get Layer Base Name in ModelBuilder (For Calculating with Joins) in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794015#M2756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This turned out to be really easy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a (new??) model only tool called, "Parse Pathname"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You supply a dataset, and select which "piece" of the dataset path name you want returned to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are four options, easy to select from a drop-down in the tool. In my case, "name" is what I needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Name" returns the name of the dataset, minus the file path or any extension. This is precisely what is needed to do a calculation on a join.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jan 2012 11:30:35 GMT</pubDate>
    <dc:creator>RandyMcGregor</dc:creator>
    <dc:date>2012-01-27T11:30:35Z</dc:date>
    <item>
      <title>Get Layer Base Name in ModelBuilder (For Calculating with Joins)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794014#M2755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have several models that perform calculations with joins.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These calculations require you to enter the name of the joined table, then it's field name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[FIELD] = [JOINEDTABLE.FIELD]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I have done is to give "hard coded" names to output tables so they are always the same:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This makes it easier to do the calculation, but once in a while the table isn't deleted (model bombs) AND a lock gets placed on it so it can't be overwritten.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are ways around this, of course, but what I would like to do is create unique table names, but I don't know how to extract just the table name in ModelBuilder (in Python os.path.basename(full table path) does the trick).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried [FIELD] = [%tablename%.FIELD], but of course that creates a calculation string like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[FIELD] = &lt;C&gt;&lt;/C&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I'm close, but just need a little nudge in the right direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your time,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 12:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794014#M2755</guid>
      <dc:creator>RandyMcGregor</dc:creator>
      <dc:date>2012-01-25T12:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get Layer Base Name in ModelBuilder (For Calculating with Joins)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794015#M2756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This turned out to be really easy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a (new??) model only tool called, "Parse Pathname"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You supply a dataset, and select which "piece" of the dataset path name you want returned to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are four options, easy to select from a drop-down in the tool. In my case, "name" is what I needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Name" returns the name of the dataset, minus the file path or any extension. This is precisely what is needed to do a calculation on a join.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 11:30:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794015#M2756</guid>
      <dc:creator>RandyMcGregor</dc:creator>
      <dc:date>2012-01-27T11:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get Layer Base Name in ModelBuilder (For Calculating with Joins)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794016#M2757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That tool has been around for years, it's one of those tools you see, wonder why you would&amp;nbsp;&lt;EM&gt;ever&lt;/EM&gt; use it and forget it even exists. Then just like you one discovers it and has a "oh &lt;EM&gt;that's&lt;/EM&gt; what it is for!" moment. My most recent discover is the Join Field tool! For years I have been Adding a join, calculate then breaking the join...As Homer would say doh!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Duncan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 09:23:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794016#M2757</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2016-09-29T09:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get Layer Base Name in ModelBuilder (For Calculating with Joins)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794017#M2758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Join Field weren't so darn slow!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Oct 2016 02:14:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-layer-base-name-in-modelbuilder-for/m-p/794017#M2758</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2016-10-29T02:14:08Z</dc:date>
    </item>
  </channel>
</rss>

