<?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 Handling Attributes in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357407#M28205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a simple question that is hard to explain. I have drawn a little picture to help explain. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]26206[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg" rel="nofollow" target="_blank"&gt;https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I have table 1 and I want to get to table 2 based on the values in an attribute field. I know that there is a maximum of 12 unique values for any one D value. This means at max I would have 12 new fields (which can be named 1 - 12). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 1000's of D values in total.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice on where to start, would be helpful. I have tried an intersect and join but found they only returned one value for each D. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jul 2013 13:54:35 GMT</pubDate>
    <dc:creator>BrendanQuigley</dc:creator>
    <dc:date>2013-07-25T13:54:35Z</dc:date>
    <item>
      <title>Handling Attributes</title>
      <link>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357407#M28205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a simple question that is hard to explain. I have drawn a little picture to help explain. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]26206[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg" rel="nofollow" target="_blank"&gt;https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I have table 1 and I want to get to table 2 based on the values in an attribute field. I know that there is a maximum of 12 unique values for any one D value. This means at max I would have 12 new fields (which can be named 1 - 12). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 1000's of D values in total.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice on where to start, would be helpful. I have tried an intersect and join but found they only returned one value for each D. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 13:54:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357407#M28205</guid>
      <dc:creator>BrendanQuigley</dc:creator>
      <dc:date>2013-07-25T13:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Attributes</title>
      <link>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357408#M28206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello &lt;BR /&gt;&lt;BR /&gt;I have a simple question that is hard to explain. I have drawn a little picture to help explain. &lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]26206[/ATTACH]&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg" rel="nofollow" target="_blank"&gt;https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Basically I have table 1 and I want to get to table 2 based on the values in an attribute field. I know that there is a maximum of 12 unique values for any one D value. This means at max I would have 12 new fields (which can be named 1 - 12). &lt;BR /&gt;&lt;BR /&gt;I have 1000's of D values in total.&lt;BR /&gt;&lt;BR /&gt;Any advice on where to start, would be helpful. I have tried an intersect and join but found they only returned one value for each D. &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what the pivot table does, although you would need an Advanced license to use that tool.&amp;nbsp; For the unique value field if you are sure it has no duplicates you can use it as both the pivot field and the value field.&amp;nbsp; The result would be that every record with 6 in the unique field would be in the UNIQUE_6 column and have a value of 6 or null.&amp;nbsp; However, all columns numbered UNIQUE_1 through UNIQUE5 and UNIQUE_7 thru UNIQUE_12 wouldl have null values if 6 was the only value associated with the D value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you wanted the value of 6 to be in the second column when there are only two values for a given D value, then you need to Sort the table and create a new numeric field to calculate a unique number indicating the column position of each value.&amp;nbsp; This requires Sort/Summary, add numeric column, calculate it to equal ObjectID, Summarize on D value and get the min of the new column, Join, calculate the new column to equal:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sort_table.New_Column - Join_Table.Min_New_Column + 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that will result in each value being in order with all null column being in positions after the filled in columns.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:56:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357408#M28206</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-07-25T14:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Attributes</title>
      <link>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357409#M28207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This is what the pivot table does, although you would need an Advanced license to use that tool.&amp;nbsp; For the unique value field if you are sure it has no duplicates you can use it as both the pivot field and the value field.&amp;nbsp; The result would be that every record with 6 in the unique field would be in the UNIQUE_6 column and have a value of 6 or null.&amp;nbsp; However, all columns numbered UNIQUE_1 through UNIQUE5 and UNIQUE_7 thru UNIQUE_12 wouldl have null values if 6 was the only value associated with the D value.&lt;BR /&gt;&lt;BR /&gt;If you wanted the value of 6 to be in the second column when there are only two values for a given D value, then you need to Sort the table and create a new numeric field to calculate a unique number indicating the column position of each value.&amp;nbsp; This requires Sort/Summary, add numeric column, calculate it to equal ObjectID, Summarize on D value and get the min of the new column, Join, calculate the new column to equal:&lt;BR /&gt;&lt;BR /&gt;Sort_table.New_Column - Join_Table.Min_New_Column + 1&lt;BR /&gt;&lt;BR /&gt;that will result in each value being in order with all null column being in positions after the filled in columns.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wow, this looks like it is working. I haven't tackled the sort part yet. With the simple PivotTable_management I am getting more rows than I require. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Every D with one year is being put in the table, then the last D with have the two years that is suppose to go with it. Can I somehow eliminate the duplicates that only have the single data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 15:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357409#M28207</guid>
      <dc:creator>BrendanQuigley</dc:creator>
      <dc:date>2013-07-25T15:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Attributes</title>
      <link>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357410#M28208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Wow, this looks like it is working. I haven't tackled the sort part yet. With the simple PivotTable_management I am getting more rows than I require. &lt;BR /&gt;&lt;BR /&gt;Every D with one year is being put in the table, then the last D with have the two years that is suppose to go with it. Can I somehow eliminate the duplicates that only have the single data?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure I understand your last sentence.&amp;nbsp; Sounds like you should do a Summary Statistics instead of Sort in the steps I mentioned.&amp;nbsp; You could then select based on a count value if that applies.&amp;nbsp; Do the pivot on that summary.&amp;nbsp; If that does not help, please explain further what you mean.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 16:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-attributes/m-p/357410#M28208</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-07-25T16:13:33Z</dc:date>
    </item>
  </channel>
</rss>

