Merge getNegativeValueCount and getDictValueCount to one function