URL: http://GPUDB_IP_ADDRESS:GPUDB_PORT/aggregate/statistics/byrange
Divides the given set into bins and calculates statistics of the values of a valuecolumn in each bin. The bins are based on the values of a given binningcolumn. The statistics that may be requested are mean, stdv (standard deviation), variance, skew, kurtosis, sum, min, max, first, last and weighted average. In addition to the requested statistics the count of total samples in each bin is returned. This counts vector is just the histogram of the column used to divide the set members into bins. The weighted average statistic requires a weight column to be specified in weight_column_name. The weighted average is then defined as the sum of the products of the value column times the weight column divided by the sum of the weight column.
There are two methods for binning the set members. In the first, which can be used for numeric valued binningcolumns, a min, max and interval are specified. The number of bins, nbins, is the integer upper bound of (maxmin)/interval. Values that fall in the range [min+n*interval,min+(n+1)*interval) are placed in the nth bin where n ranges from 0..nbin2. The final bin is [min+(nbin1)*interval,max]. In the second method, bin_values specifies a list of binning column values. Binningcolumns whose value matches the nth member of the bin_values list are placed in the nth bin. When a list is provided, the binningcolumn must be of type string or int.
NOTE: The Kinetica instance being accessed must be running a CUDA (GPUbased) build to service this request.
Input Parameter Description
Name  Type  Description  

table_name  string  Name of the table on which the rangedstatistics operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.  
select_expression  string  For a nonempty expression statistics are calculated for those records for which the expression is true. The default value is ''.  
column_name  string  Name of the binningcolumn used to divide the set samples into bins.  
value_column_name  string  Name of the valuecolumn for which statistics are to be computed.  
stats  string  A string of comma separated list of the statistics to calculate, e.g. 'sum,mean'. Available statistics: mean, stdv (standard deviation), variance, skew, kurtosis, sum.  
start  double  The lower bound of the binningcolumn.  
end  double  The upper bound of the binningcolumn.  
interval  double  The interval of a bin. Set members fall into bin i if the binningcolumn falls in the range [start+interval*i, start+interval*(i+1)).  
options  map of string to strings  Map of optional parameters:. The default value is an empty map ( {} ).

Output Parameter Description
The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:
Name  Type  Description  

status  String  'OK' or 'ERROR'  
message  String  Empty if success or an error message  
data_type  String  'aggregate_statistics_by_range_request' or 'none' in case of an error  
data  String  Empty string  
data_str  JSON or String  This embedded JSON represents the result of the /aggregate/statistics/byrange endpoint:
Empty string in case of an error. 