BUG

Invalid results when using IDataStatistics with IDataStatistics.Cursor

Last Published: April 25, 2020

Description

IDataStatistics.Statistics and IDataStatistics.UniqueValues do not always process the cursor supplied to the DataStatistics object through IDataStatistics.Cursor. The results are not accurately computed.

Cause

The cursor, processed by the DataStatistics object, is set by IDataStatistics.Cursor. Like all cursors, it is a read-once cursor; however, both IDataStatistics.Statistics and IDataStatistics.UniqueValues iterate through the cursor. That means that if the cursor is set and then both IDataStatistics.Statistics and IDataStatistics.UniqueValues are called, the second method will not iterate through the cursor because it is already at the end.

Workaround



Always set IDataStatistics.Cursor to be a new cursor that has not been iterated through, before calling either IDataStatistics.Statistics or IDataStatistics.UniqueValues.

Article ID:000004393

Software:
  • ArcMap 8 x
  • ArcMap 9 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic