I need to come up with a report for a social services agency that counts the prevailing language of service for each client every month. We have come up with a clear definition of what constitutes a prevailing language of service, but now I have to figure out how to implement it.
If a client comes in 3 times in a month and is served in English twice and Albanian the third time, then English is clearly prevailing. If they come in 4 times and English is used twice and Albanian twice then we have a tie and have to go through some select cases to decide which will be declared the prevailing language. The select case part is fine and I can deal with that. My problem is how to count each language and determine which one is used the most and whether there was a tie.
I considered using top values for this but it is arbitary if there is a tie. So if I create a recordset in VBA and count the occurrence of each language, how do I determine if there is a clear winner or a tie?