Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to calculate % of females out of my total population. My excel file has columns like Name, ID,....... Gender, etc. and each ID has a gender (male or female).
I tried applying the following formula but it's not working:-
Sum([Gender]={'Female'}) / Sum([Gender]={'Female'}) + Sum([Gender]={'Male'})
Thoughts?
Thanks!
Ankit
Try this:
Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT ID)
UPDATE: Added DISTINCT in case you have duplicate IDs and you don't want to count them twice
Try this:
Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT ID)
UPDATE: Added DISTINCT in case you have duplicate IDs and you don't want to count them twice
Hi Sunny,
Thanks for your quick response. Appreciate it!
So, I am trying to show the percentage in a Gauge chart, and the formula still doesn't seem to be working. Here's a snapshot of what I am seeing. I know my data and it should show 49.30% but it shows 0.50%
Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT ID)
Am I doing something wrong?
Thank you!
Ankit
Count([Gender]={'Female'} PersonField) / (Count([Gender]={'Female'} PersonField) + Count([Gender]={'Male'} PersonField))
*/ precedes +-
But is the syntax correct Clever? I have never seen a syntax like that before.
sorry, sunny, I´ve didn´t checked this, only noted /- precedence
Count({<[Gender]={'Female'}.>} PersonField) / (Count({<[Gender]={'Female'}>}PersonField) + Count({<[Gender]={'Male'}>}PersonField))
No sorry needed my friend. I was just wondering if this syntax actually works
Are there places where Gender is not filled in?
May be try this:
Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT {<Gender = {'Female', 'Male'}>}ID)
Silly me. This formula is perfect. I just added *100 at the end to make it a percentage to make it work. The needle does show the correct female representation now.
Thanks a lot!
Ankit
Thanks for pitching in, Clever! Appreciate it.
Cheers!
Ankit