If you change your map to grep, then your code works correctly.
In reply to Re: Count non-empty hash values by Util in thread Count non-empty hash values by pboin