Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rebeccakutz
New Contributor II

Include a Condition in a #1 KPI.

@Dear Qlik Community

I've chooses a KPI to show how many employess work in a company, by using the count expression. However, people either work in Sales/Marketing or Production. I would like to include that as a condition in my KPI. I tried the following:

=count(if([job_function]='Production'_A,[job_function])

However it doesn't work. Does anyone has a hint for me?

Thanks and kind regards,

Rebecca

11 Replies
micheledenardi
Valued Contributor

Re: Include a Condition in a #1 KPI.

Maybe:

Count({<[job_function]={'Production'}>}[job_function])

felipedl
Valued Contributor III

Re: Include a Condition in a #1 KPI.

Hi Rebecca,

Use set analysis for it, something like:

count({<job_function{'Production','Sales','Marketing'}>}job_function)

rebeccakutz
New Contributor II

Re: Include a Condition in a #1 KPI.

perfect. this it is

rebeccakutz
New Contributor II

Re: Include a Condition in a #1 KPI.

The recommendation form Michele De Nardi was the one I was looking for.

Thank you all.

YoussefBelloum
Esteemed Contributor

Re: Include a Condition in a #1 KPI.

Hi,

what is that '_A' ? and there is a missing bracket..

exp.png

agigliotti
Honored Contributor II

Re: Include a Condition in a #1 KPI.

I think you need something as below:

count( distinct employerID )

MVP
MVP

Re: Include a Condition in a #1 KPI.

What is the additional _A used for?

Capture.PNG

rebeccakutz
New Contributor II

Re: Include a Condition in a #1 KPI.

this was a mistake in the expression

micheledenardi
Valued Contributor

Re: Include a Condition in a #1 KPI.

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.