Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sicdude
Contributor III
Contributor III

Count of Subset of data

I have a set of claims that all contain member information.  I want to get a count of Male/Female of the distinct member#'s.   I thought initially a simple count of gender field would be sufficient, but then I realized that I was counting the claims and not the distinct members.   

do I need to create the distinct member subset on load or is there a way to do it through an expression? I'm hoping there's a way to do it with an expression.   

1 Solution

Accepted Solutions
NitinK7
Specialist
Specialist

Hi sicdud,

try the following expression

 

Count(Distinct {$< Gender={"Male"}>}member)

Count( Distinct {$< Gender={"Female"}>}member) 

 

regards,

Nitin.

View solution in original post

11 Replies
martinpohl
Partner - Master
Partner - Master

as you said

count (#member) give you the numebr of members in general and if the field #member is used in each claim line is is counted as many as they are available.

count(distinct #member) is counting each different #member one time.

better is a

1 as count_member

in your member table and a sum (count_member) as expression

Regards

sicdude
Contributor III
Contributor III
Author

@martinpohl  right, but I'm not counting the members, I need to count how many male/female out of the distinct members from the table.  so example, there's 100 claims, but only 25 different members, I need the count of 13 Male and 12 Female

Vegar
MVP
MVP

Assuming that gender is a property of a member then you could use set analysis. Assuming your member count expression is  sum (count_member) .

Then you can do like this

sum ( {$< Gender={"Male"}>}count_member)

sum ( {$< Gender={"Female"}>}count_member) 

MSchatz
Contributor II
Contributor II

Bom dia!

tenho algo parecido que também não estou conseguindo fazer, tenho uma coluna na minha tabela, coluna Cargo, nessa coluna tem vários cargos, Comprador, Vendedor, Gerente, Analista, etc.... e queria contar quantos vendedor tem.

segue essa mesma logica?

Att. 

MSchatz

NitinK7
Specialist
Specialist

Hi sicdud,

try the following expression

 

Count(Distinct {$< Gender={"Male"}>}member)

Count( Distinct {$< Gender={"Female"}>}member) 

 

regards,

Nitin.

Vegar
MVP
MVP

Yes, use the same logic

Count( {< Position = {'Vendedor'}>} Position)

sicdude
Contributor III
Contributor III
Author

@NitinK7  Thank you for this, it worked for what I needed for this  

Count(Distinct {$< [sex]={"M","F"}, statusdesc={1} >} [member#])

However, what if I had like 15 or 30 different options in the "Sex" field?   is there a way to group by that entire field without having to specify out each individual option?  I have other similar charts that I would like to create, but the fields I will be using have more than just the two options.  

MSchatz
Contributor II
Contributor II

Muito Obrigado! 

sou iniciante, e estou dando meus primeiros passos 🙂

 

MSchatz
Contributor II
Contributor II

Incluindo mais um filtro, quero saber quantos vendedor tem na empresa 5.

{$ <EMPRESA = { "5"}}

?