Use the TALLY command to count the occurrence of identical values in a column or expression.
Options
colname
Specifies the name of the column from which you want to tally information.
expression
Determines a value using a text or arithmetic formula. The expression must be a value that can be evaluated from looking at data in a single row. Lookup expressions are not supported.
FROM tblview
Specifies the table or view.
WHERE clause
Limits rows of data. See WHERE.
About the TALLY Command
The TALLY command displays each value and its number of occurrences as a list. Identical values can also be counted by choosing Calculate: Tally from the Data Browser.
For the TEXT data type, the TALLY command evaluates the first 100 characters. TALLY does not work with the NOTE data type.
To display data without column headings, set HEADINGS off before using the TALLY command. Setting HEADINGS off is useful if you direct output of the TALLY command to a device (printer or file) other than the screen, for example, to a file that you intend to load into another database. The default setting for HEADINGS is on.
Use expressions and functions to perform calculations whose results appear as a column for the occurrence count result.
Examples
Example 01:
The following command lists occurrences of each customer identification number in the TransMaster table. R:BASE sorts the information in ascending order by Custid.
TALLY CustID FROM TransMaster
Example 02:
The following command lists the integer day of the month occurrences for each transaction date in the InvoiceHeader table using the IDAY function. R:BASE sorts the information in ascending order by the day of the month.
TALLY (IDAY(Transdate)) FROM InvoiceHeader
(IDAY(Transdate)) Number of Occurrences
----------------- ---------------------
1 12
2 6
3 4
5 2
6 6
7 2
9 2
10 2
11 1
12 5
13 1
14 1
15 6
16 2
17 2
18 1
19 3
20 2
21 3
22 4
23 8
25 7
26 1
27 6
28 2
29 2
30 4