One of the easiest ways is to build a value list based on the contents of the field, then use something like this calculation:
ValueCount ( ValueListItems ( Get ( FileName ) ; "ValueListName" ))
You could also use an ExecuteSQL statement to pull it, such as:
ValueCount ( ExecuteSQL ( "SELECT DISTINCT tableName.ClientID FROM tableName" ; "" ; "" ))
although I've heard that the Value List approach is faster (never tested it myself).
If you only want certain items (such as items related to a parent record), you can either build your value list based on that relationship, or you can put a WHERE clause in your SQL query.