cancel
Showing results for 
Search instead for 
Did you mean: 

How many Customers in a UserGroup?

Former Member
0 Kudos

When I search for customers in the hMc under Users, using the criteria Group contains 'mygroupname' I get 3347 as the number of results.

When I open the 'mygroupname' UserGroup and use the Find Members button, I get 3376 as the number of results. This is the same number as I get with the following Flexible Search query

    Select
     {usr:uid}
     from
     {   PrincipalGroupRelation as pgr
         JOIN User as usr
         ON {usr:pk} = {pgr:source}
         JOIN UserGroup as ug
         ON {pgr:target} = {ug:pk}
     }
     where
     {ug:uid} = 'mygroupname'


Where are the extra results coming from?

I thought some might be coming from Employees (who shouldn't be in this group) but I only found two, which doesn't account for the other 37 difference.

Adding a Select distinct makes no difference. Exporting both lists using the Select All from the results pane and exporting as CSV results in a significant proportion of duplicates in both sets of results. Can anyone shed light on why the discrepancy? Is there any way to see what query the hMc is using to find the Users where the criteria for Group contains 'mygroupname'?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Did you try to clear your cache ?

Former Member
0 Kudos

Still a puzzle, but I searched for the types and I get Customer and Employee only, so still a few people short...

 Select
 distinct {ct:code}
 from
 {   PrincipalGroupRelation as pgr
     JOIN User as usr
     ON {usr:pk} = {pgr:source}
     JOIN UserGroup as ug
     ON {pgr:target} = {ug:pk}
     JOIN ComposedType as ct
     ON {usr:itemtype} = {ct:pk}
 }
 where
 {ug:uid} = 'mygroupname'
Former Member
0 Kudos

Hi Andrew, In the hMC you search for users of type "Customer". The query however joins all items that are instance of User or any subtype of User. That means that the query most probably returns instances of type User, Employee or any other (custom) subtype of User.

Former Member
0 Kudos
  • meant ...doesn't account for the other 27 difference.