<?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: Symbolize point based on related table record entry using Python. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58195#M4586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ryan - thank you for thinking on this! I'm just stuck. I actually wonder if I'm overthinking and could accomplish this through a simple definition query (basically forgetting about the STATUS field) - see:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/55751-Simple-Definition-Query-Group-By?p=191689&amp;amp;posted=1#post191689"&gt;http://forums.arcgis.com/threads/55751-Simple-Definition-Query-Group-By?p=191689&amp;amp;posted=1#post191689&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process is this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, when the CompletedDate field is populated, we were using that as a count and when the total counts for each point equaled the record number for that point, the symbol would turn green.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The part I'm running into trouble with is how to GROUP BY the point locations. The "english" version of what I'm trying to do is: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Each location grouped by the location number (ie: all points at location 1), if CompletedDate is not null, then turn that little circle fully green (!), else, do nothing (because I can display the partially completed points using a definition query on the feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2012 16:59:40 GMT</pubDate>
    <dc:creator>MegPeterson</dc:creator>
    <dc:date>2012-04-20T16:59:40Z</dc:date>
    <item>
      <title>Symbolize point based on related table record entry using Python.</title>
      <link>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58193#M4584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all - I am a newbie to Sql and Python and am trying to convert some sql statements that a consultant put together for our old IMS/SQL set up, to work with our new ArcSDE/SQL set up and am wondering what the right approach is. At the end of this post are the original Sql statements for reference. I feel like this is an easier solution through Python and ArcMap (V.10) etc, but I'm just not putting it together.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The situation is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a point file that has a 1:Many relationship with a non-spatial table. As an example: Point #1 has 3 different maintenance issues that need fixing at that location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The symbology of the points are based on the completion of the issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;???When nothing has been fixed, the point is symbolized as a red circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;???When some things have been fixed, the point turns to a green, half circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;???When all 3 issues have been fixed, the point turns to a green circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the past, this was accomplished by basing the symbology on a "STATUS" field that referenced the 'CompletedDate' field in the related table. Whenever a date was entered in the 'CompletedDate' field the 'Status' field will automatically update and voila(!), the point color will change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;???If the date was null (ie: nothing had been worked on), the Status field would = 0, and the point color = Red.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;???If the date was not null, Status = 1 (and the point would be half green), and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;???If the CompletedDate (as a DateCount) in the related table was equal to the number of issues in the RecordCount field, the point would turn green.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering if this is something that I can run from inside the MXD through Python and the Field Calculator instead of running it in the acutal SQL database. We're using Enterprise v.10, SQL Server 2008, Flex 4.0 (where the editing will happen). We are not using versioned tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any words of wisdom, or suggestions on how to do this in Python using the Field Calculator somehow with if and else statements?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Meg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;____________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STORED PROCEDURE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CREATE PROCEDURE [sql_data].[sp_Update_ADASTATS]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;truncate table sql_data.ADASTATS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INSERT INTO sql_data.ADASTATS SELECT DISTINCT FACILITYZONEID UNIQCODE, '0', COUNT(*) FROM sql_data.ADA_Actions GROUP BY FACILITYZONEID;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UPDATE sql_data.ADASTATS SET STATUS=1 WHERE sql_data.ADASTATS.UNIQCODE IN (SELECT DISTINCT FACILITYZONEID UNIQCODE FROM sql_data.ADA_Actions WHERE CompletedDate IS NOT NULL);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UPDATE sql_data.ADASTATS SET STATUS=2 WHERE sql_data.ADASTATS.UNIQCODE IN (SELECT DISTINCT UNIQCODE FROM sql_data.vw_ADASTATS WHERE DateCount = RecCount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GO&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;____________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VIEW&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT Sql_data.ADASTATS.UNIQCODE, Sql_data.ADASTATS.RECCOUNT, COUNT(Sql_data.ADA_Actions.CompletedDate) AS DateCount&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM Sql_data.ADA_Actions INNER JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sql_data.ADASTATS ON Sql_data.ADA_Actions.FacilityZoneID = Sql_data.ADASTATS.UNIQCODE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHERE (Sql_data.ADA_Actions.CompletedDate IS NOT NULL)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY Sql_data.ADASTATS.UNIQCODE, Sql_data.ADASTATS.RECCOUNT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 13:45:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58193#M4584</guid>
      <dc:creator>MegPeterson</dc:creator>
      <dc:date>2012-04-18T13:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Symbolize point based on related table record entry using Python.</title>
      <link>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58194#M4585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Meg,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I saw this the other day and have been trying to think of a way to do this through Python.&amp;nbsp; I would like to ask a few questions to better understand what you're trying to do and then offer up an idea that just occured to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How exactly are you tracking these issues?&amp;nbsp; Are they empty fields that get populated and thus having been populated they are considered resolved?&amp;nbsp; If this is the case then I believe I have an idea that might work for you.&amp;nbsp; It wouldn't be as instant, but at the end of an editing session you could run the script and it would update the [STATUS] field accordingly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A script could perhaps check the length each of the three (or however many) fields, if they return 0 (aka empty) the script could set the [STATUS] for that record to 0/unresolved, if one or more of the fields return &amp;gt;0 then it could set the status to 1/in_progress and if all of the fields return &amp;gt;0 then the status could be set to 2/resolved and then the dots can be symbolized by the varrying levels of the status field.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 14:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58194#M4585</guid>
      <dc:creator>RyanForbes1</dc:creator>
      <dc:date>2012-04-20T14:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Symbolize point based on related table record entry using Python.</title>
      <link>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58195#M4586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ryan - thank you for thinking on this! I'm just stuck. I actually wonder if I'm overthinking and could accomplish this through a simple definition query (basically forgetting about the STATUS field) - see:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/55751-Simple-Definition-Query-Group-By?p=191689&amp;amp;posted=1#post191689"&gt;http://forums.arcgis.com/threads/55751-Simple-Definition-Query-Group-By?p=191689&amp;amp;posted=1#post191689&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process is this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, when the CompletedDate field is populated, we were using that as a count and when the total counts for each point equaled the record number for that point, the symbol would turn green.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The part I'm running into trouble with is how to GROUP BY the point locations. The "english" version of what I'm trying to do is: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Each location grouped by the location number (ie: all points at location 1), if CompletedDate is not null, then turn that little circle fully green (!), else, do nothing (because I can display the partially completed points using a definition query on the feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 16:59:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/symbolize-point-based-on-related-table-record/m-p/58195#M4586</guid>
      <dc:creator>MegPeterson</dc:creator>
      <dc:date>2012-04-20T16:59:40Z</dc:date>
    </item>
  </channel>
</rss>

