Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking through a public data set which has the sex of both victims and perpetrators
I am wanting to show the Count where both the victim and the perpetrator are the same
e.g The count where Victim and the Perpetrator are both "Male"
The variables are Victim_Sex and Perp_Sex
Any help would be appreciated
=count({<Victim_Sex ={'Male'},Perp_Sex={'Male'}>} ID)
It can be done in different ways, it depends on where and how you want to use it. But to display the figure in a text box you could do something like this. I'm using field name [case_id] as key, you should use whatever key you have in your data.
= count({$<Victim_Sex={"Male"}, Perp_Sex={"Male"}>}distinct [case_id])
That expression uses "set expression" syntax. Another way to do it could be:
= sum(if(Victim_Sex='Male' and Perp_Sex='Male', 1, 0))
Both examples should give you the number of cases where both the victim and the perpetrator are male.
Hi Michael,
see Attachment.
Regards,
Antonio
= sum(if(Victim_Sex=Perp_Sex, 1, 0))
Hi,
other solutions could be:
-Sum(Victim_Sex=Perp_Sex)
or
Count({$<CaseID={"=Victim_Sex=Perp_Sex"}>} CaseID)
hope this helps
regards
Marco