Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ishanahiya
Contributor
Contributor

Combine expression

I want to create one expression that will accomplish all these things. Can you help?

Part I

I want to sum the populations in these States

Sum({<[States] = {'Iowa' , 'Delaware'}>}[Population]

Without this Gender

Sum({<[Gender] - = {'Male'}>}[Population])

Part II

Return No for this State instead of a Population value

If([States]='South Dakota','No',

Without this Gender

Sum({<[Gender] - = {'Male'}>}[Population])

Part III

Add both expressions together so the total does not sum to No and records with Gender Male do not display in the table.

1 Solution

Accepted Solutions
MayilVahanan

Hi @ishanahiya ,

Try like below

Part I: Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] - = {'Male'}>}[Population])

Part 2:  If([States]='South Dakota','No', Sum({<[Gender] - = {'Male'}>}[Population]))

Part 3: 

If([States]='South Dakota','No', Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] - = {'Male'}>}[Population]))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

Hi @ishanahiya ,

Try like below

Part I: Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] - = {'Male'}>}[Population])

Part 2:  If([States]='South Dakota','No', Sum({<[Gender] - = {'Male'}>}[Population]))

Part 3: 

If([States]='South Dakota','No', Sum({<[States] = {'Iowa' , 'Delaware'},[Gender] - = {'Male'}>}[Population]))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.