<?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: Comparing multiple fields to each other within one feature class using Python? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163657#M12512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcd'&lt;/SPAN&gt;

e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ab'&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;max&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;was using the phone... max is the correct, rather than sum, since it will either be 0 or 1, so even a single 1 will trigger&lt;/P&gt;&lt;P&gt;Again, substitute the letters for your field names&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:34:15 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T08:34:15Z</dc:date>
    <item>
      <title>Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163652#M12507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a feature class of 5 fields that I'm looking at. I'm looking to compare 4 fields to 2 other fields. Essentially, if any of the first 4 fields match to the other 2 fields then I want to return a "YES" in a new field. If none of the 4 fields match the 2 fields, then I want to return a NO. I started typing this out in the field calculator, but I'm unsure if this is the most efficient method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a beginner at python, so here is my code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;def TextValue(MATCH):
&amp;nbsp; if !JURIS! or !MGMT1! or !MGMT2! or !MGMT3! == !EDC_MGMT! or !EDC_JURIS!:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return = "YES"
&amp;nbsp; elif:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return = "NO"‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Am I going about this the right way? Let me know if my question should be clarified.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:34:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163652#M12507</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2021-12-11T08:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163653#M12508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
sum&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;substitute the numbers for your field names.&amp;nbsp; If the sum is &amp;gt; 0, then it is true, otherwise false&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:34:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163653#M12508</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T08:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163654#M12509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only thing is that they're text fields. Unless I'm misunderstanding you? I'm unsure how this would still apply. Also, can I still do this in the field calculator?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:12:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163654#M12509</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2018-04-11T15:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163655#M12510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[0, 1][sum([True for i in [!a!, !b!, !c!, !d!] if i in [!e!, !f!])]&lt;/P&gt;&lt;P&gt;would be a field calculator expression, python parser, a to f are field names&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:27:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163655#M12510</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-11T15:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163656#M12511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is more than 1 match, you will get an index error.&amp;nbsp; Also&amp;nbsp;a bracket is missing.&lt;/P&gt;&lt;P&gt;[0, 1][sum([True for i in [!a!, !b!, !c!, !d!] if i in [!e!, !f!]&lt;SPAN style="color: #ff0000;"&gt;]&lt;/SPAN&gt;)]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is a&amp;nbsp;nice way to make multiple comparisons.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a'&lt;/SPAN&gt;
b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b'&lt;/SPAN&gt;
c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'c'&lt;/SPAN&gt;
d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'d'&lt;/SPAN&gt;

e &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'d'&lt;/SPAN&gt;
f &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; sum&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"yes"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; sum&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"no"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# results&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
yes
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163656#M12511</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T08:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163657#M12512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcd'&lt;/SPAN&gt;

e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ab'&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;max&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;was using the phone... max is the correct, rather than sum, since it will either be 0 or 1, so even a single 1 will trigger&lt;/P&gt;&lt;P&gt;Again, substitute the letters for your field names&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:34:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163657#M12512</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T08:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multiple fields to each other within one feature class using Python?</title>
      <link>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163658#M12513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this in the code block:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;TextValue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;juris&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mgmt1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mgmt2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mgmt3&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; edc_mgmt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; edc_juris&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; s4 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; set&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;juris&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mgmt1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mgmt2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mgmt3&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; s2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; set&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;edc_mgmt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; edc_juris&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; s2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;intersection&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s4&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YES"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NO"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and call it like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;TextValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!JURIS!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !MGMT1!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !MGMT2!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !MGMT3!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !EDC_MGMT!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !EDC_JURIS!&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:34:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-multiple-fields-to-each-other-within-one/m-p/163658#M12513</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T08:34:18Z</dc:date>
    </item>
  </channel>
</rss>

