var statDef = new StatisticDefinition(); statDef.statisticType = "sum"; statDef.onStatisticField = "Area"; statDef.outStatisticFieldName = "Tot Area"; var query = new Query(); query.returnGeometry = false; query.where = "Area>0"; query.outFields = ["Area"]; query.outStatistics = [ statDef ]; query.groupByFieldsForStatistics = ["YearEstabl", "TypeName"]; query.orderByFields = ["YearEstabl", "TypeName"]; var qt = new QueryTask("http://services1.arcgis.com/Mpa25zPNMAT08GQg/ArcGIS/rest/services/AllPropertiesEstablished/FeatureServer/0"); qt.execute(query, function(result){ ... } });
Yes Jason, not seeing any other difference, other than Supports statistics......So rokitmaps, atleast you can give it a try by setting SupportsStatistics true for the layer.....
Interesting. This sample does use where clause for the statistical calculation, and it works. The main difference I can tell is the sample uses a feature layer that supports statistics, while rokitmaps uses a feature service.
statDef.outStatisticFieldName = "Tot Area";
statDef.outStatisticFieldName = "TotArea";
When using outStatistics the only other parameters that will be used are groupByFieldsForStatistics, orderByFields, text, time, and where.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.