Creating histograms
Concept Information
Creating a histogram groups the records in a table, counts the number of records in each group, and displays the groups and counts in a vertical bar chart.
You can group the records:
- Based on identical values in a character field (similar to classifying)
- Into equal-sized, or custom-sized, numeric intervals (similar to stratifying)
Break field available for some output formats
In addition to a bar chart, you can also output the results to screen, to a text file, or to print. When outputting results in these formats, you can optionally break down the results based on the values in a character field, such as customer ID or transaction type. For this option to yield meaningful results, the character field you use for the breakdown must be sorted prior to creating the histogram.
Subtotaling numeric fields
Unlike the other grouping operations in Analytics, histograms do not support subtotaling numeric fields.
Histograms and sorting
You can create a histogram using sorted or unsorted tables. When you use an unsorted table Analytics automatically sorts the output results in ascending order as part of creating the histogram.
Steps
You can create a histogram that groups the records in a table and displays the groups in a bar chart.
You can group the records:
- Based on identical values in a character field
- Into equal-sized, or custom-sized, numeric intervals
- Select .
- On the Main tab, do one of the
following:
Select the field on which to base the histogram from the Histogram On drop-down list.
Click Histogram On to select the field, or to create an expression.
- If you selected a numeric field or expression in Histogram
On, do the following:
- In Minimum, enter
the minimum value of the first interval.
If you previously performed a profile or statistics operation on the numeric field, the lowest value in the field is automatically entered by default. You can change the default, if required.
- In Maximum, enter the maximum
value of the last interval.
If you previously performed a profile or statistics operation on the numeric field, the highest value in the field is automatically entered by default. You can change the default, if required.
- In Minimum, enter
the minimum value of the first interval.
- If you selected a numeric field or expression in Histogram
On, do one of the following:
Select Intervals, and enter the number of equal-sized intervals that you want in the range specified by the Minimum and Maximum values. The default number of intervals is 10.
Tip
You can change the default number of intervals by selecting Intervals number on the Command tab.
and updating theSelect Free to create custom-sized intervals, and enter the start value of each interval and the end value of the last interval. You must enter each value on a separate line.
Specifying Minimum and Maximum values is optional when you use Free. If you do specify Minimum and Maximum values, those values are the start point of the first interval and the end point of the last interval, and the values you enter create additional intervals within the range. The values you enter must be greater than the value specified in Minimum, and equal to or less than the value specified in Maximum.
-
If there are records in the current view that you want to exclude from processing, enter a condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the specified condition.
- Click the Output tab.
-
Select the appropriate output option in the To panel:
- Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save the results to a file than to display the results on the screen.
- Print – Select this option to send the results to the default printer.
- Graph – Select this option to create a graph of the results and display it in the Analytics display area.
- File – Select this option to save or append the results to a text file. The file is saved outside Analytics.
Note
Output options that do not apply to a particular analytical operation are disabled.
- Screen – Select this option to display the results in the Analytics display area.
-
If you selected File as the output type, specify the following information in the As panel:
- File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics you are using) is the only option. Saves the results to a new text file, or appends the results to an existing text file.
- Name – Enter a file name in the Name text box. Or click Name and enter the file name, or select an existing file in the Save or Save File As dialog box to overwrite or append to the file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to save or append the file in a location other than the project location. For example: C:\Results\Output.txt or Results\Output.txt.
- Local – Disabled and selected. Saving the file locally is the only option.
-
Depending on the output type, you can optionally specify a Header and/or a Footer in the text box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header or footer text to left align the text. Click Header or Footer to enter a header or footer of more than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the header or footer text box. Left aligning multiple lines requires a left angle bracket at the beginning of each line.
- Click the More tab.
-
Select the appropriate option in the Scope panel:
- All
- First
- Next
- While
Show me moreAll This option is selected by default. Leave it selected to specify that all records in the view are processed. First Select this option and enter a number in the text box to start processing at the first record in the view and include only the specified number of records. Next Select this option and enter a number in the text box to start processing at the currently selected record in the view and include only the specified number of records. The actual record number in the leftmost column must be selected, not data in the row. While Select this option to use a WHILE statement to limit the processing of records in the view based on a particular criterion or set of criteria. You can enter a condition in the While text box, or click While to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no further records are considered. You can use the While option in conjunction with the All, First, or Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or the indexed order of records in a table, and disregards any filtering or quick sorting applied to the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
- If you do not want to include values that exceed the specified Minimum and Maximum values, select Suppress Others.
- Optional. If you are outputting histogram results to
a text file, specify the length of the x-axis in the textual representation
of the bar chart by entering a number in Columns.
The number you enter specifies the number of character spaces (text columns) to use for the x-axis (and the y-axis labels). In most cases, you can leave Columns blank to use the default of 78 character spaces.
- Optional. If you are outputting histogram results to screen, a file, or printer, enter the name of a break field in the Break text box, or click Break to select the field, or to create an expression.
For example, a histogram of an accounts receivable table could be broken down by customer. Break can only be used with a single character field, so nested breakdowns are not supported.
Note
For the Break option to yield meaningful results, the character field must be sorted prior to creating a histogram.
- If you selected File as the output type, and want to append the output results to the end of an existing text file, select Append To Existing File.
- Click OK.
- If the overwrite prompt appears, select the appropriate option.