<?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 Statistics Query with Pagination when using orderby with fieldname other than ObjectId in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/statistics-query-with-pagination-when-using/m-p/1382684#M83647</link>
    <description>&lt;P&gt;Do pagination query work only when orderBy is OBJECTID.&lt;BR /&gt;&lt;BR /&gt;I am using a statistics query like below, where I want to run a count statistics on a total of 50k+ records.&lt;BR /&gt;I am trying to retrieve 2000 records per query using pagination. But the results are always returned for the first 2000 records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do a pagination query for the statistics I am trying to achieve here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saxina_0-1707980843281.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/94855i30F6B01F1150B0E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saxina_0-1707980843281.png" alt="Saxina_0-1707980843281.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 07:31:09 GMT</pubDate>
    <dc:creator>Saxina</dc:creator>
    <dc:date>2024-02-15T07:31:09Z</dc:date>
    <item>
      <title>Statistics Query with Pagination when using orderby with fieldname other than ObjectId</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/statistics-query-with-pagination-when-using/m-p/1382684#M83647</link>
      <description>&lt;P&gt;Do pagination query work only when orderBy is OBJECTID.&lt;BR /&gt;&lt;BR /&gt;I am using a statistics query like below, where I want to run a count statistics on a total of 50k+ records.&lt;BR /&gt;I am trying to retrieve 2000 records per query using pagination. But the results are always returned for the first 2000 records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do a pagination query for the statistics I am trying to achieve here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saxina_0-1707980843281.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/94855i30F6B01F1150B0E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saxina_0-1707980843281.png" alt="Saxina_0-1707980843281.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 07:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/statistics-query-with-pagination-when-using/m-p/1382684#M83647</guid>
      <dc:creator>Saxina</dc:creator>
      <dc:date>2024-02-15T07:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Query with Pagination when using orderby with fieldname other than ObjectId</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/statistics-query-with-pagination-when-using/m-p/1383489#M83667</link>
      <description>&lt;P&gt;Hi there&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It is accepted and should work. Do you have a reproducible case so I can take a look? For example the following query returns &lt;A href="https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Bev%20Hills%20Trees/FeatureServer/0/query?f=html&amp;amp;groupByFieldsForStatistics=COMMON%2CBOTANICAL&amp;amp;resultRecordCount=5&amp;amp;where=(COMMON%20is%20not%20null)&amp;amp;orderByFields=SpeciesCount%20desc&amp;amp;outFields=*&amp;amp;outStatistics=%5B%7B%22onStatisticField%22%3A%22COMMON%22%2C%22outStatisticFieldName%22%3A%22SpeciesCount%22%2C%22statisticType%22%3A%22count%22%7D%5D&amp;amp;spatialRel=esriSpatialRelIntersects" target="_self"&gt;this result&lt;/A&gt; from the service.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const summaryQuery = layer.createQuery();
 summaryQuery.set({
   where: "(COMMON is not null)",
   outFields: ["*"],
   groupByFieldsForStatistics: ['COMMON', 'BOTANICAL'],
   orderByFields: ['SpeciesCount desc'],
   outStatistics: [{
     statisticType: "count",
     onStatisticField: "COMMON",
     outStatisticFieldName: "SpeciesCount"
   }],
   num: 5
 });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 16:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/statistics-query-with-pagination-when-using/m-p/1383489#M83667</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-02-16T16:55:37Z</dc:date>
    </item>
  </channel>
</rss>

