<?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: Query resultRecordCount ignores returnDistinctValues in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259384#M1266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is actually a bug. &lt;A href="https://gis.mcassessor.maricopa.gov/arcgis/rest/services/Subdivisions/MapServer/0/query?where=shape_area+%3C+2000&amp;amp;text=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;outFields=MCR_BOOK&amp;amp;returnGeometry=false&amp;amp;returnTrueCurves=false&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;gdbVersion=&amp;amp;returnDistinctValues=true&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;queryByDistance=&amp;amp;returnExtentsOnly=false&amp;amp;datumTransformation=&amp;amp;parameterValues=&amp;amp;rangeValues=&amp;amp;f=html"&gt;Here's a distinct query on a 10.5.1 service&lt;/A&gt; that returns 881 records with&amp;nbsp;count but 534 without count. A &lt;A href="https://services.arcgis.com/b6gLrKHqgkQb393u/arcgis/rest/services/TaxParcelQuery/FeatureServer/0/query?where=SCHLDSCRP+is+not+null&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=SCHLDSCRP&amp;amp;returnGeometry=false&amp;amp;returnCentroid=false&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnDistinctValues=true&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=false&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token="&gt;similar query on a 10.6.1 service&lt;/A&gt; returns the same number of distinct records with and without count. Doesn't seem to matter if I do executeForCount or&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;resultRecordCount.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Oct 2018 16:33:44 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2018-10-02T16:33:44Z</dc:date>
    <item>
      <title>Query resultRecordCount ignores returnDistinctValues</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259382#M1264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My goal is to query the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;resultRecordCount&lt;/SPAN&gt; with &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;returnDistinctValues = true&lt;/SPAN&gt; with one output field. Reason is because the result is sometimes more than 1000 and I need to paginate the queries and I can't do that without knowing the total number of distinct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it seems that&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;resultRecordCount&lt;/SPAN&gt;&amp;nbsp;is ignoring the&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;returnDistinctValues&lt;/SPAN&gt;&amp;nbsp;parameter and counting everything. Is there another way I can count distinct records? Maybe with some trickery using &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;outStatistics&lt;/SPAN&gt; or &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;groupByFieldsForStatistics&lt;/SPAN&gt;? I'm on ArcGIS Enterprise 10.5.1 calling REST MapServer through &lt;A href="https://community.esri.com/space/2128"&gt;ArcGIS API for JavaScript&lt;/A&gt; 4.7.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2018 23:53:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259382#M1264</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2018-09-27T23:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Query resultRecordCount ignores returnDistinctValues</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259383#M1265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Blake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If you use executeForCount, then the returnDistinctValues will work to let you know if the map services&amp;nbsp;MaxRecordCount is high enough to work with one query.&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForCount" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForCount"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForCount&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2018 23:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259383#M1265</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-10-01T23:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query resultRecordCount ignores returnDistinctValues</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259384#M1266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is actually a bug. &lt;A href="https://gis.mcassessor.maricopa.gov/arcgis/rest/services/Subdivisions/MapServer/0/query?where=shape_area+%3C+2000&amp;amp;text=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;outFields=MCR_BOOK&amp;amp;returnGeometry=false&amp;amp;returnTrueCurves=false&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;gdbVersion=&amp;amp;returnDistinctValues=true&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;queryByDistance=&amp;amp;returnExtentsOnly=false&amp;amp;datumTransformation=&amp;amp;parameterValues=&amp;amp;rangeValues=&amp;amp;f=html"&gt;Here's a distinct query on a 10.5.1 service&lt;/A&gt; that returns 881 records with&amp;nbsp;count but 534 without count. A &lt;A href="https://services.arcgis.com/b6gLrKHqgkQb393u/arcgis/rest/services/TaxParcelQuery/FeatureServer/0/query?where=SCHLDSCRP+is+not+null&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=SCHLDSCRP&amp;amp;returnGeometry=false&amp;amp;returnCentroid=false&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnDistinctValues=true&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=false&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token="&gt;similar query on a 10.6.1 service&lt;/A&gt; returns the same number of distinct records with and without count. Doesn't seem to matter if I do executeForCount or&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;resultRecordCount.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259384#M1266</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2018-10-02T16:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Query resultRecordCount ignores returnDistinctValues</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259385#M1267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm. could be you should make a call to tech support on that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:43:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259385#M1267</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-10-02T16:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Query resultRecordCount ignores returnDistinctValues</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259386#M1268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Esri Support was able to replicate the issue and created&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;BUG-000117336 : The "returnDistinctValues" parameter is ignored when querying a ArcGIS Server 10.6 service with "resultRecordCount" / "Return Count only" parameter.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The development team will be reviewing the bug and will provide us further updates. The issue is not reproducible in the latest release of ArcGIS Server 10.6.1 and can be used as a workaround.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 20:09:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/query-resultrecordcount-ignores/m-p/259386#M1268</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2018-10-09T20:09:26Z</dc:date>
    </item>
  </channel>
</rss>

