# Discrepancy in surname count between Top Surnames and Statistics

**URL:** <https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167>\
**Category:** Help\
**Created:** [January 22, 2022, 5:24pm UTC](https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167 "2022-01-22T17:24:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![codefarmer](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@codefarmer](https://gramps.discourse.group/u/codefarmer)\
**Post date:** [January 22, 2022, 5:24pm UTC](https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167/1 "2022-01-22T17:24:21Z")

</div>

Gramps AIO 5.1.4 on Windows 10

Top Surnames gramplet on the dashboard reports “Total unique surnames: 60” while the Statistics gramplet under Family Information, reports “Unique surnames: 50”.

A manual count of surnames in the People Grouped view shows 59 surnames and I guess one more count is added for the people with missing surnames, so 60 matches the output of “Top Surnames” .

Statistics doesn’t seem to be reporting surnames of individuals, but rather Families. In my tree I counted 34 unique family surnames, and ~11 families with no surname which still doesn’t add up to 50. What is the data “Statistics report” is reporting?

For consistency, it would be good for Statistics gramplet to show unique surnames under individuals as well.

 ![TopSurnames vs StatisticsSurnames](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/8/8c6473439db2308e91f0f116e9228eac7d2943e6.png)

---

<div class="post-metadata">

**Author:** ![prculley](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/prculley/32/41_2.png) [@prculley](https://gramps.discourse.group/u/prculley)\
**Post date:** [January 22, 2022, 5:51pm UTC](https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167/2 "2022-01-22T17:51:17Z")

</div>

The Statistics Gramplet unique surnames is derived from the surnames found under persons primary names. So this doesn’t include surnames that might be found under person alternate names,  
This information is actually tracked internal to the database.

The Top Surnames Gramplet does include the alternate names for people when looking for surnames.  
This is developed by scanning all the people and examining primary and alternate names.

An interesting example of what happens when different authors write code…

---

<div class="post-metadata">

**Author:** ![codefarmer](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@codefarmer](https://gramps.discourse.group/u/codefarmer)\
**Post date:** [January 22, 2022, 6:39pm UTC](https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167/3 "2022-01-22T18:39:40Z")

</div>

@prculley That makes sense. To count people with primary names in my family tree, I created a filter based on People with Name Type=Birth Name and the result was exactly 50 surnames, so that matches your explanation.

For consistency it would be awesome to have documented, library of utility methods such as this count of surnames (there may even be an official function for this) and have authors reuse it, but that is difficult to make happen in practice.

Thanks!

---

<div class="post-metadata">

**Author:** ![daleathan](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/daleathan/32/1701_2.png) [@daleathan](https://gramps.discourse.group/u/daleathan)\
**Post date:** [January 22, 2022, 9:56pm UTC](https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167/4 "2022-01-22T21:56:20Z")

</div>

To add to this; a number of bug reports have been made since at least Gramps 3.4.5

- [0006793: Gramplets “Surname Cloud” and “Top Surnames” with different counts of “Total unique surnames”](https://gramps-project.org/bugs/view.php?id=6793)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [February 21, 2022, 9:56pm UTC](https://gramps.discourse.group/t/discrepancy-in-surname-count-between-top-surnames-and-statistics/2167/5 "2022-02-21T21:56:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
