def get_field_statistics(entries, field, sub_field=None, include_NA=True):
    """
    Given a list of entries, calculates statistics about a field content and returns the statistics.

    If include_NA is True, N/A is used if no field was specified

    :param entries: list of entries
    :param include_NA: If true, adds N/A if field is not contained in entry
    :return: list of tuples (field content, occurrence) sorted by descending occurrences
    """

    # gather field content
    values = []
    for entry in entries:
        if sub_field:
            entry = entry[sub_field]
        if field in entry:
            values.extend(entry[field])
        elif include_NA:
            values.append('N/A')

    # unique field content
    unique_values = set(values)

    # count occurrences and sort
    values_stat = [(l, values.count(l)) for l in unique_values]
    values_stat.sort(key=lambda x: str.casefold(x[0]))  # first sort by name
    values_stat.sort(key=lambda x: -x[1])  # then sort by occurrence (highest occurrence first)

    return values_stat