Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ajit_aarya
Contributor II
Contributor II

If statement

This is my table, 

And i need population count of portland from AZ state

 

i Tried this

Count(If(match(city, 'portland' and state, 'AZ') Population)) but its not working

city state population 
portland ME 10
chicago IL 27
portland AZ 21
portland MI 51
Labels (2)
2 Solutions

Accepted Solutions
Qlik_Eric_Thomas

Try using Set Analysis instead, something like:

Sum({<city={'portland'}, state={'AZ'}>}Population)

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

Qlik_Eric_Thomas

The Expression I gave should give you the population for Portland, AZ and just that. If you use that expression in a KPI, that's exactly what I will show. 

If you replaced the 'Population' field in the table with my expression, you should only see 1 row.

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

4 Replies
Qlik_Eric_Thomas

Try using Set Analysis instead, something like:

Sum({<city={'portland'}, state={'AZ'}>}Population)

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!
ajit_aarya
Contributor II
Contributor II
Author

That works..

but what if we wanna print that

like i want city field where city is portland and state is AZ

 

If({<city={'portland'}, state={'AZ'}>}City)

Will this works??

 

Qlik_Eric_Thomas

The Expression I gave should give you the population for Portland, AZ and just that. If you use that expression in a KPI, that's exactly what I will show. 

If you replaced the 'Population' field in the table with my expression, you should only see 1 row.

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!
ajit_aarya
Contributor II
Contributor II
Author

I want to locate a city in map chart with using both city name and state name.

***Consider there is a city portland in ME state**

In map chart, There this location field,

In chart, i want only portland from ME but there are few different portlands in different states, 

When i am using a AND function like If(mixmatch(city,'Portland' and state,'ME'),City)

 

that syntax is not working