title: how to count distinct values in Json
body: <p>json file</p>
  
  <pre><code>{"people":[{"Name":"Ray Parker","Email":"luctus.et.ultrices@natoque.ca","State":"Wyoming","Country":"Tuvalu","Martial Status":"Divorced","Department Name":"Tech Support","Company Name":"Borland","Title":"Dr.","Gender":"Male"},
  {"Name":"Davis Hooper","Email":"et.libero.Proin@egetvarius.org","State":"Nunavut","Country":"Bangladesh","Martial Status":"Divorced","Department Name":"Public Relations","Company Name":"Cakewalk","Title":"Mr.","Gender":"Female"}, ...... and so on
  </code></pre>
  
  <p>I like to make a json object from this with the distinct values of Country and the count of people in that country.</p>
  
  <p>I tried the code</p>
  
  <pre><code>        $(document).ready(function() {
  
      var data = $.ajax({
          url: "Data_prop.json",
          dataType: "json",
          async: false
      }).responseText;
  
      var unique = {};
      var param = "Country"
      $.each(data.people, function() {
          if (!unique[this[param]])
              unique[this[param]] = [];   
          unique[this[param]].push(this);
      });
  
      for(var d in unique) {
        alert(d);
      }
  
          }); 
  </code></pre>
  
  <p>The error i got in console</p>
  
  <pre><code>TypeError: a is undefined
  https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  Line 2
  </code></pre>
  
  <p>Does any have an idea how to do this?</p>