Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
EvanBarrick
Creator
Creator

Expressions with Conditions

I am creating a simple pie chart for gender. The data set has these possible values for Gender

-FEMALE, Female, MALE, Male, rbtFemale and rbtMale

I want to create the chart where I group the Female, FEMALE and rbtFemale into a expression as Female and the same for Male.

 

So I think my expression would be something similar to =Count(If(Gender ='Male' or Gender ='MALE' or Gender = 'rbtMale', UserID)) but I do not get the expected results

2 Replies
Wlad_Masi
Employee
Employee

What about If(Gender ='Male' or Gender ='MALE' or Gender = 'rbtMale', count UserID) ?

You may be able to use substring function, but I think you will have to use a function to change everything to lower case and look for the substring "Male" after it.
To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
Vegar
MVP
MVP

You could solve it by using set analysis

Male:

= count({<Gender={'Male','MALE','rbtMale'}>}UserID) 

Female:

= count({<Gender={'Female','FEMALE','rbtFemale'}>}UserID) 

 BR 

Vegar