<?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: Arcade Count intersecting polyline features by distinct value in field  in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656926#M32726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response that blog link is useful I can just about figure out what's happening I ll give it a shot and try,&amp;nbsp; if i am really stuck I may ask for your help . A couple of additional points I had hope to use collector and pass values to survey123 however I realised featureset s were not supported.&amp;nbsp; I am now calculating the fields first&amp;nbsp; to pass them through.i am setting up a model in pro to do this but I was wondering if arcade expressions ,specifically using featuresetbyportalitem , are achievable using the python Api&amp;nbsp; and would it be a faster method then model builder to run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know if collector or the new field maps app&amp;nbsp; will support featuresets anytime soon?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2020 20:31:36 GMT</pubDate>
    <dc:creator>PaulSweeney3</dc:creator>
    <dc:date>2020-09-15T20:31:36Z</dc:date>
    <item>
      <title>Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656921#M32721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a polygon layer and a polyline layer for the polyline layer i am able to count the distinct features using the following arcade expression. The distinct values are found by removing the last two numbers of the string&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Var textlenght =COUNT(TEXT($feature["label"]))
Var label = textlenght-2
var stringleft = Left($feature["label"], label)
var sql = "label LIKE '%" + stringleft+"%'"
var Filt = filter($layer,sql)
return count(Filt)&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the polygon layer i am able to get the total length of those polyline s in my first layer&amp;nbsp; that intersect it using the following&amp;nbsp;expression&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;// get the ug Duct feature set:
var sql = "(surface_ty = '" + 2 + "'"+" OR "+"surface_ty = ' " +3+ "'"+" OR "+"surface_ty = ' " +4+ "'"+" OR "+"surface_ty = ' " +5+ "'"+" OR "+"surface_ty = ' " +6+ "'"+" OR "+"surface_ty = ' " +7+ "')"+" AND "+"(status = '" + 1 + "'"+" OR "+"status = ' " +3+ "')"
var lines = filter(FeatureSetByName($map,"LLD_Fibre_Duct_TLI"),sql)
// polylines that intersect with the polygon
var relevantlines = Intersects($feature, lines);

var cnt = Count(relevantlines);

var totlengthUG = 0;

if (cnt &amp;gt; 0) {
 for (var line in relevantlines) {
 var lineint = Intersection(line, $feature);
 totlengthUG += LengthGeodetic(lineint, 'm');
 } 
}
return round(totlengthUG,2)&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is the the polylines are overlapping and each polyline represents a duct in a trench. I want to be able to combine the two functions and divide the total length by the count of distinct polylines in order to get the trench length . I guess i would have to iterate through the feature set of the label field in the polyline and replace the values ,then sum them into an array where i can count the new distinct values i just cant figure out how to get this iteration to work. &lt;A href="https://community.esri.com/migrated-users/3100" target="_blank"&gt;Xander Bakker&lt;/A&gt;‌ perhaps you can help ?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:48:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656921#M32721</guid>
      <dc:creator>PaulSweeney3</dc:creator>
      <dc:date>2021-12-12T03:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656922#M32722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/316237"&gt;Paul Sweeney&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your second code block I see that&amp;nbsp;you are using a pretty long SQL&amp;nbsp;query, but it&amp;nbsp;does not contain any variables. Will it contain variable in the future? If not you could simplify it to:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"(surface_ty IN ('2', '3', '4', '5', '6', '7') AND status IN ('1', '3'))"&lt;/SPAN&gt;&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;P&gt;And do you have additional spaces in front of ' 3', ' 4', ' 5', ' 6' and ' 7'? Because that is what your SQL is querying for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see any problem in combing both expression into a single one and using the count from the first with the total length from the second to calculate trench length. It would be easier to see the data to understand what the limitations might be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 13:05:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656922#M32722</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-09-10T13:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656923#M32723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100" target="_blank"&gt;Xander Bakker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back. In relation to the sql yes i think the reason it was like that is because i considered using variables at the start and then it changed, it was just easier for me to change it to a number. The number relates to a surface type. Your suggestion is much neater however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I probably did not explain myself fully the first time , the label where i take the last two letters may vary over the polygon so for example you may have 6 polylines in total intersecting the polygon 4 of these maybe overlapping polylines with the same label number and 2 may be another set of overlapping polylines with a different label with different lengths and different surfaces see example below. What i would like to show is the distance in grass total and the distance in footpath total for example.&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;orig label 	New Label 	      Length Surface
123456/28	  123456	          1.5	grass
123456/29	  123456	          1.5	grass
123456/30	  123456	          1.5	grass
123456/31	  123456	          1.5	grass
123456/32	  123456	          1.5	grass
678910/45	  678910	           3	footpath 
678910/46	  678910	           3	footpath 
599910/48	  599910	           5	grass
599910/49	  599910	           5	grass
	
Total length 	        23.5
Total trenches 	         3	
Distance in grass 	11.5
Distance in footpath 	3	
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i tired to combine them originally but i couldn't figure out how to iterate through the polyline feature and group the various distinct labels and sum them by surface.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656923#M32723</guid>
      <dc:creator>PaulSweeney3</dc:creator>
      <dc:date>2021-12-12T03:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656924#M32724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/316237"&gt;Paul Sweeney&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the additional explanation.&amp;nbsp;It is possible to loop through the features, intersect the geometry and read out the surface and length to determine the total length per surface. If you would not&amp;nbsp;intersect the geometry it wold be much easier using the GroupBy function as explained here (in Spanish, sorry):&amp;nbsp;&lt;A href="https://community.esri.com/docs/DOC-13951"&gt;Incluir reportes estadísticas en las ventanas emergentes con Arcade usando GroupBy&lt;/A&gt;&amp;nbsp;and in English in the blog post by Paul Barker:&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/whats-new-in-arcade/" title="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/whats-new-in-arcade/"&gt;What’s New in Arcade 1.8&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:06:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656924#M32724</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-09-11T17:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656925#M32725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can help you creating the expression, but I would need access to the data. You can create a group in AGOL, share the data or a portion of it and the map and invite muy AGOL user "xbakker.spx" to the group. That way I can see what is possible and provide you with a working Arcade expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:08:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656925#M32725</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-09-11T17:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field </title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656926#M32726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response that blog link is useful I can just about figure out what's happening I ll give it a shot and try,&amp;nbsp; if i am really stuck I may ask for your help . A couple of additional points I had hope to use collector and pass values to survey123 however I realised featureset s were not supported.&amp;nbsp; I am now calculating the fields first&amp;nbsp; to pass them through.i am setting up a model in pro to do this but I was wondering if arcade expressions ,specifically using featuresetbyportalitem , are achievable using the python Api&amp;nbsp; and would it be a faster method then model builder to run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know if collector or the new field maps app&amp;nbsp; will support featuresets anytime soon?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 20:31:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656926#M32726</guid>
      <dc:creator>PaulSweeney3</dc:creator>
      <dc:date>2020-09-15T20:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656927#M32727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/316237"&gt;Paul Sweeney&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;EM style="background-color: #ffffff; "&gt;Do you know if collector or the new field maps app&amp;nbsp; will support featuresets anytime soon?&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Unfortunately, I do not know if this will be supported anytime soon. I do have ArcGIS Field Maps installed, but I haven't had the opportunity to play with it a lot. The best way of getting an answer to this question, would be to engage in the&amp;nbsp;early adopter community and talk directly to the product managers and developers and being able to influence those features that will be included in the final version:&amp;nbsp;&lt;A class="link-titled" href="https://earlyadopter.esri.com/key/ArcGISFieldMaps" title="https://earlyadopter.esri.com/key/ArcGISFieldMaps"&gt;ArcGIS Field Maps&lt;/A&gt;&amp;nbsp;(Early Adopter Site)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;A couple of additional points I had hope to use collector and pass values to survey123 however I realised featureset s were not supported.&amp;nbsp; I am now calculating the fields first&amp;nbsp; to pass them through.i am setting up a model in pro to do this but I was wondering if arcade expressions ,specifically using featuresetbyportalitem , are achievable using the python Api&amp;nbsp; and would it be a faster method then model builder to run.&amp;nbsp;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Using a model, a python script, a home baked GP tool or a Jupyter notebook and the Python API are all ways you can use to do this. Make sure the identity that you are using has access to the data and use the option that works best for you.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2020 19:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656927#M32727</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-09-16T19:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656928#M32728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks xander i might post the question in the early adopter site if it hasn't already been asked. in relation to the model option&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set about creating the model on ArcGIS Pro and i have run into an issue wiithon of my expressions. Which totals the number of unique sections intersecting a polygon based on shape length.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var portal = Portal('https://www.arcgis.com');&lt;BR /&gt;// get the ug Duct feature set:&lt;BR /&gt;var sql = "(surface_ty = '" + "1" + "')"+" AND "+"(status = '" + 1 +"')";&lt;BR /&gt;var Ducts = Intersects($feature,filter(FeatureSetByPortalItem(portal, 'xxxxxxxxxxx', 0),sql));&lt;BR /&gt;var groupSections = GroupBy(Ducts,['Shape__Length'],[{ name: 'outputStatName', expression: '1', statistic: 'COUNT' }]);&lt;BR /&gt;// count the overlapping lines&lt;BR /&gt;var cnt = Count(groupSections);&lt;BR /&gt;return cnt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using calculate field the expression validates ok&amp;nbsp; but it will not run it fails with the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-02701-02725-002717.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-02701-02725-002717.htm"&gt;002717: Invalid Arcade expression—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;with no real description of why it is failing&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a solution i found if i use the distinct function instead of grouby&amp;nbsp; it works and returns the desired output but i was wondering if this is a bug or is &lt;STRONG&gt;groupby&lt;/STRONG&gt; not available to use in Arcgis pro ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2020 10:18:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656928#M32728</guid>
      <dc:creator>PaulSweeney3</dc:creator>
      <dc:date>2020-09-22T10:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Count intersecting polyline features by distinct value in field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656929#M32729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/paul.sweeneyTLI" target="_blank"&gt;paul.sweeneyTLI&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the expression below and the&amp;nbsp;comments in the code explaining some things to look at:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// I would change the variable name portal, since it is a existing function&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; myportal &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Portal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'https://www.arcgis.com'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// If the sql does not have any variables, don't make it more complex than needed&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//var sql = "(surface_ty = '" + "1" + "')"+" AND "+"(status = '" + 1 +"')";&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"(surface_ty = '1') AND (status = '1')"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// for testing cut the nested expressions into single lines&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// limite the fields to the 1 that you need and don't extract the geometry&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; fs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByPortalItem&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myportal&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'xxxxxxxxxxx'&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="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Shape__Length'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; False&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"fs:"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fs&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="comment token"&gt;// filter the featureset&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; fsfiltered &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"fsfiltered:"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fsfiltered&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="comment token"&gt;// during intersection note that the first argument is the featureset and the second the feature!&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; Ducts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Intersects&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fsfiltered&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Ducts:"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Ducts&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="comment token"&gt;// groupby is only used to group features by an attribute and return some statistic&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// example: group ducts by material and return the total length by material&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// doing a count on the results of a GroupBy will get you the number of different categories&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// var groupSections = GroupBy(Ducts,['Shape__Length'],[{ name: 'outputStatName', expression: '1', statistic: 'COUNT' }]);&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// count the overlapping lines&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Ducts&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; cnt&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;/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;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>Sun, 12 Dec 2021 03:48:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-count-intersecting-polyline-features-by/m-p/656929#M32729</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T03:48:37Z</dc:date>
    </item>
  </channel>
</rss>

