Select to view content in your preferred language

Statistics Query with Pagination when using orderby with fieldname other than ObjectId

410
1
02-14-2024 11:31 PM
Saxina
by
Occasional Contributor

Do pagination query work only when orderBy is OBJECTID.

I am using a statistics query like below, where I want to run a count statistics on a total of 50k+ records.
I am trying to retrieve 2000 records per query using pagination. But the results are always returned for the first 2000 records. 

Is there a way to do a pagination query for the statistics I am trying to achieve here? 

Saxina_0-1707980843281.png

 

0 Kudos
1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there 

It is accepted and should work. Do you have a reproducible case so I can take a look? For example the following query returns this result from the service. 

 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
 });

 

 

0 Kudos