Select to view content in your preferred language

Geoprocessor Statistics paramater

720
2
Jump to solution
09-18-2013 09:24 AM
JohnStephens
Regular Contributor
For the Statistics geoprocessor tool one of the parameters is the "statistics_fields". It calls for the fields you want to get statistics on as well as the type of statistic. In pyton, it looks like this (see 3rd param):

arcpy.Statistics_analysis("futrds", "C:/output/output.gdb/stats", [["Shape_Length", "SUM"]], "NM")


My question is, how do I set up this parameter in .NET?

Geoprocessor GP = new Geoprocessor();  Statistics stats = new Statistics(); stats.in_table = @"C:\Temp\Test\myRight.shp"; stats.out_table = @"C:\Temp\test.dbf"; stats.statistics_fields = "[['J_Fld','COUNT']]";  GP.Execute(stats, null);


I've tried sending it strings formatted in several different ways, an array like the one in python, and a IVariantArray with no luck.

Thanks.
0 Kudos
1 Solution

Accepted Solutions
JohnStephens
Regular Contributor
So, I went ahead and contacted ESRI support and figured out how to solve this problem. The parameter is set like this:

stats.statistics_fields = "J_Fld COUNT"; stats.case_field = "J_Fld";

View solution in original post

0 Kudos
2 Replies
JohnStephens
Regular Contributor
So, I went ahead and contacted ESRI support and figured out how to solve this problem. The parameter is set like this:

stats.statistics_fields = "J_Fld COUNT"; stats.case_field = "J_Fld";
0 Kudos
KenBuja
MVP Esteemed Contributor
The documentation on the parameters for geoprocessing tools has never been very good. Usually, when I run into a problem with the syntax, the first thing I'll do is to manually run the tool in ArcMap. I'll open the Results dialog and examine the messages for the Executing statement. This is the best way to figure out how the parameters should be entered for the different properties.
0 Kudos