You can use the SUMMARIZE command:
dt = New Table( "Month-Fruit",
Add Rows( 5 ),
New Column( "Month", Numeric, Continuous,
Format( "Best", 12 ), Set Values( [1, 1, 1, 2, 2] )
),
New Column( "Fruit", Character, Nominal,
Set Values( {"ORANGE", "ORANGE", "APPLE", "ORANGE", "APPLE"} )
)
);
summarize(f = by(:month, :Fruit), c = count);
show(f, c);
f = {{"1", "1", "2", "2"}, {"APPLE", "ORANGE", "APPLE", "ORANGE"}};
c = [1, 2, 1, 1];
The way to interpret the output is that there are 4 unique combinations of month and fruit.
For month 1, APPLE the count is 1
For month 1, ORANGE the count is 2
For month 2, APPLE the count is 1
For month 2, ORANGE the count is 1