Among the nearly infinite numbers of doing this, here are some ideas.
Create a copy of the view “Groups.” Call the new view “Group Members Full”. Delete all the columns except the Group column. Add a new Categorized column before Group. Call that column “Name.” Choose the field Members as the contents for the column. Refresh and save the view. When collapsed, this view will have the total number of unique names for your NAB. Click and drag the first column. The message line will display the number of selected lines. This will include the names of groups that are contained in other groups.
If you want a prompt to show the number of unique names in the view, create a formula action with this code. (this is derived from code I have that works. This specific code combination is untested. Let me know if it works.)
GroupMembers := @Trim(@Unique(@DbColumn(“” : “NoCache”;”";”Group Members Full”; 1)));
NumMembers := @Elements(GroupMembers);
@prompt([ok]; “Number of names”; @text(NumMembers))
Document this new view in whatever you use to document systems. Make sure you save it to a code library or Notes design object store somewhere that is documented and known. If the nab design takes it out due to an upgrade or whatever reason, replace it from your code library.