DefineRangeHistogram Command |
|
Two forms of histogramming requests are supported by Flexible Search: the Return Count requests and the Return Results requests. At most one histogramming request can be made within a single search request.
The Return Count requests can be used in addition to a simple request to return the number of items found in each category, range or time frame. Meanwhile, the data is returned, filtered and sorted without regard to category, range or time frame.
The Return Results requests are used in place of a simple request. In addition to the number of items being returned for each category, range or time frame, the actual data is filtered, sorted and returned by category, range or time frame for display.
The Return Count by Range requests is one of the Return Count requests, and is used to return the number of records found for each of a number of defined numeric ranges. A numeric range index is used to define the ranges. Either all ranges defined by the index or a selected subset may be used.
Both the Return Count by Range and Return Results by Range requests use the DefineRangeHistogram command. The Return Count by Range request uses the DefineRangeHistogram command with only two arguments to return the number of ranges containing items matching the search criteria, as well as the number of items matching the search criteria for each selected range.
To return a subset of the ranges containing results matching the search criteria, pass the name of an HTML variable, containing the list of range base values, in the proper order, to the command as the second argument. A range base value is the lower limit of the range. To return all ranges, pass the proper control character as the second argument: a plus sign (+) to display in ascending order, or a minus sign (-) to display in descending order by base value.
To select a specific list of ranges for display in a predetermined order, use the following format:
DefineRangeHistogram( idx, lst );
DefineRangeHistogram Arguments (Predetermined Order)
Argument |
Description |
idx |
The range index to be searched. |
lst |
The name of the HTML variable containing the list of range base values in the display order. |
To select all ranges for display, sorted in either ascending or descending order, use the following format:
DefineRangeHistogram( idx, ctl );
DefineRangeHistogram Arguments (Ascending/Descending Order)
Argument |
Description |
idx |
The range index to be searched. |
ctl |
The display control character ( + or - ). The display control character may be passed directly or within an HTML variable. |
To select a specific list of ranges for display in a predetermined order, use the following format:
DefineRangeHistogram( idx, lst, cnt );
DefineRangeHistogram Arguments (Predetermined Order)
Argument |
Description |
idx |
The range index to be searched. |
lst |
The name of the HTML variable containing the list of range base values in the display order. |
cnt |
The maximum number of items to display for each range. The count may be passed directly or within an HTML variable. |
To select all ranges for display, sorted in either ascending or descending order, use the following format:
DefineRangeHistogram( idx, lst, cnt );
DefineRangeHistogram Arguments (Ascending/Descending Order)
Argument |
Description |
idx |
The range index to be searched. |
ctl |
The display control character ( + or - ). The display control character may be passed directly or within an HTML variable. |
cnt |
The maximum number of items to display for each range. The count may be passed directly or within an HTML variable. |
Access the DefineRangeHistogram Dialog Box by selecting the Range Histogram menu item under the Categories category of the Logic Template editor command menu.
Examples
Return the number of results found for each individual range identified by the numeric range index "Price".
Command |
Description |
DefineRangeHistogram( Price, PriceRanges ); |
Return the count for each of the individual ranges identified within the HTML variable, "PriceRanges". |
DefineRangeHistogram( Price, + ); |
Return the count for each individual range, displaying those ranges in ascending order by range base value. |
DefineRangeHistogram( Price, - ); |
Return the count for each individual range, displaying those ranges in descending order by range base value. |
DefineRangeHistogram( Price, Direction ); |
Return the count for each individual range in either ascending or descending order by range base value, as identified within the HTML variable, "Direction". |
DefineRangeHistogram( Price, PriceRanges, 5 ); |
Return up to 5 results for each of the ranges identified within the HTML variable, "PriceRanges". |
DefineRangeHistogram( Price, +, 5 ); |
Return up to 5 results for each individual range, displaying those ranges in ascending order by range base value. |
DefineRangeHistogram( Price, -, Count ); |
Use HTML variable, "Count", to determine the number of results to be returned for each individual range, and display those ranges in descending order by range base value. |
DefineRangeHistogram( Price, Direction, 5 ); |
Return up to 5 results for each individual range in either ascending or descending order by range base value, as identified within the HTML variable, "Direction". |