This function takes the following parameters:
Attribute containing the values to be counted.
Integer to hold the counted values.