Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jbchurchill
Creator
Creator

Implausible sex ratio percentages

Using this customers table (shown below) and this set analysis ...

((Count({<customers.modified_gender={'Female'}>}customers.modified_gender)) / (count(customers.modified_gender)) * 100)

and a data filter for the same field, I'm getting unexpected results such as 28.8% female when. I'm hoping someone can offer some theories to help get this back on track.

It occurred to me as I was posting this I probably needed to edit the expression and add {1} to the denominator but now the number never changes.

((Count({<customers.modified_gender={'Female'}>}customers.modified_gender)) / (count({1}customers.modified_gender)) * 100)

 

jbchurchill_0-1660934492612.png

 

3 possible values (M/F/Unspecified)3 possible values (M/F/Unspecified)

Labels (2)
1 Solution

Accepted Solutions
luizcdepaula
Creator III
Creator III

One last try.

((Count({<customers.modified_gender*={'Female'}>}customers.modified_gender)) / (count(Total {<[customers.modified_gender]=>}customers.modified_gender)) * 100)

View solution in original post

6 Replies
luizcdepaula
Creator III
Creator III

Try the below:

((Count({<customers.modified_gender={'Female'}>}customers.modified_gender)) / (count(Total customers.modified_gender)) * 100)

jbchurchill
Creator
Creator
Author

That does seem to give a correct answer and probably the best one we can use. I was expecting that when  1. Nothing was selected it would show that number (the correct percentage)

2. Female was selected it would show 100%

3. Unspecified and/or Male were selected, it would show 0%

etc.

luizcdepaula
Creator III
Creator III

Use the below:

((Count({<customers.modified_gender={'Female'}>}customers.modified_gender)) / (count(Total {<[customers.modified_gender]=>}customers.modified_gender)) * 100)

jbchurchill
Creator
Creator
Author

That appears to be giving the same result as the first one you provided (Thanks BTW!; that gives me a possible way forward). It just never changes with the selection (always the total percentage of females out of the total population). I sort of expected that if I chose male the female % would show 0% and same if I chose "unspecified". 

luizcdepaula
Creator III
Creator III

One last try.

((Count({<customers.modified_gender*={'Female'}>}customers.modified_gender)) / (count(Total {<[customers.modified_gender]=>}customers.modified_gender)) * 100)

luizcdepaula
Creator III
Creator III

I am glad it worked out! Cheers!