COUNT_DIFF
Applies to PredictiveInsight only.
Syntax
COUNT_DIFF(data)
Parameters
data
The cell range to count the unique values and the frequency of their occurrence. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your IBM® product.
Description
COUNT_DIFF finds the number of different values in the specified data range and counts the number of times each value appears. It returns two new columns. The first column contains each unique value. The second column contains the number of times the corresponding value appeared in the data range. COUNT_DIFF ignores case when comparing text strings. For example, "Aaa" and "aAa" and "AAA" are all counted as the same class.
*
The COUNT_DIFF macro function may take a long time to compute when data is large. A "Computing…" progress bar will be displayed until the computation is complete. If you decide to cancel the computation, click on the "X" in the progress bar and delete the function definition containing the COUNT_DIFF macro function.
Examples
Creates two new columns named TEMP and VX. TEMP contains the values 1, 2, and 3. VX contains the counts 2, 1, and 1.
Creates two new columns named TEMP and VX. TEMP contains the values x, a, and b. VX contains the counts 1, 2, and 1.
Creates two new columns named TEMP and VX, where TEMP contains all of the unique values in column V1, and VX contains a count for each corresponding row of TEMP.
Creates two new columns named TEMP and VX, where TEMP contains all of the unique values in columns V1 - V3, and VX contains a count for each corresponding row of TEMP.
Creates two new columns named TEMP and VX, where TEMP contains all of the unique values in rows 10-20 of column V1, and VX contains a count for each corresponding row of TEMP.
Creates two new columns named TEMP and VX, where TEMP contains all of the unique values in rows 1-5 of columns V1 - V4, and VX contains a count for each corresponding row of TEMP.
Related Functions