You are here: Commands > Histogram

Histogram

This Histogram command is only available in command mode from a procedure or from the Command Log.

Use the Histogram command to produce a bar graph of the distribution of records over the values of a field or expression. You can send the result to a file, the screen or once the data is in the form of a graph, you can specify other types of graphs. Histogram is useful in providing an overview of a file’s contents. Histogram works on unsorted data.

For details on output options, see Graphs and Graph Output.

A horizontal representation of the graph also appears in the Command Log. An occurrence of field or expression values within a given range is represented by an asterisk (*). Each asterisk represents a single, partial or multiple number of occurrences, as required, to fit the Histogram into the designated number of columns. The Command Log shows how many occurrences each asterisk represents.

If you close the graph, you can call it up again by double-clicking the command or output in the Command Log.

Histogram offers the following options:

A histogram of numeric fields with a specified number of equally-sized intervals.
A histogram of numeric fields with intervals of varying size. The Free option lets you specify the interval sizes.
A histogram of nonnumeric fields or expression values. A histogram bar is displayed for each unique value of the field or expression. These values are displayed in ascending sorted order.

Parameters

In addition to the command parameters described below, the Histogram command has the following command parameters: Append, First, GroupBy, If, Next, Suppress, To and While. For a description of these parameters, see Command Parameters. For a description of supported field modifiers see Field Modifiers.

On

Allows you to specify the field or expression for which you want to develop a histogram. You can use character or numeric field types.

Columns

Allows you to specify the number of columns that you want for the horizontal Command Log representation of the histogram graph. Interval counts are scaled to the space available. The default is 78.

Free

Specifies start and end points.

For numeric histograms only, it allows you to specify the starting point of each interval and the ending point of the last range. Enter the starting point of each range in the Free text box, one value per line. The last number entered is interpreted as the end of the final range.

Intervals

Applies to numeric fields only. It allows you to specify the number of even intervals Analyzer produces over the range of minimum to maximum.

The default is 10, but you can change this in the Options dialog.

To change command option preferences, see Command Options.

Maximum

Applies to numeric fields only and allows you to specify the maximum value of the last interval. If you issued a Profile or Statistics command, the default is the highest value in the numeric field. Otherwise, no default exists.

Minimum

Applies to numeric fields only and allows you to specify the minimum value of the first interval. If you issued a Profile or Statistics command, the default is the lowest value in the numeric field. Otherwise, no default exists.

Command Mode Syntax

HISTOGRAM <ON> numeric-field-name

<INTERVALS=n> MAXIMUM=max MINIMUM=min¿

HISTOGRAM <ON> numeric-field-name

FREE Interval-start-points Final-interval-end-point¿

HISTOGRAM <ON> character-field-name¿

You can add the following options to each syntax format:

<TO text-file-name|SCREEN|GRAPH>

<IF test> <WHILE test>

<FIRST|NEXT range>

<GROUPBY field <+ ...>> <PRESORT>

<SUPPRESS>

<COLUMNS=n>

<APPEND>