Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

collegehunkschr
New Contributor II

How to write expression to Count([Job ID]) by another dimension

Hi all,

Here's what i'm trying to achieve.

I have a list of jobs. I can count the number of jobs by using Count([Job ID]) as the expression. I'm creating a table that shows those counts as the expression with a dimension of Zone Name. But of those jobs, some were completed, some were cancelled and some were lost. I want to create a table with columns for each of those, so like a column with Count([Job ID]) for completed, another column with Count([Job ID]) for cancelled and another column with Count([Job ID]) for closed.

I know this is probably incredibly simple, but i'm just not sure about the syntax for how to write the expression. Can someone help me?

Thank you!

Chris

1 Solution

Accepted Solutions
groveliam
Contributor

Re: How to write expression to Count([Job ID]) by another dimension

I don't know what your field is called so lets say Status can be completed or closed.

Count({<Status = {'completed'}>}[Job ID])

Count({<Status = {'closed'}>}[Job ID])

4 Replies
groveliam
Contributor

Re: How to write expression to Count([Job ID]) by another dimension

I don't know what your field is called so lets say Status can be completed or closed.

Count({<Status = {'completed'}>}[Job ID])

Count({<Status = {'closed'}>}[Job ID])

pablo_trevisan
Contributor II

Re: How to write expression to Count([Job ID]) by another dimension

You can use

Count({<Status = {'completed'}>}distinct [Job ID]) to count only one for each ID.

collegehunkschr
New Contributor II

Re: How to write expression to Count([Job ID]) by another dimension

Thank you. Do you feel like taking it a step farther for me? I also then want to be able to create another column that measures the completion percentage. So this would simply be the Completed column we just created, divided by the total column that I already had that is just Count([Job ID]).

Do you know how I can write this and display it as a percentage?

groveliam
Contributor

Re: How to write expression to Count([Job ID]) by another dimension

Gotcha

Count({<Status = {'completed'}>}[Job ID]) / Count([Job ID])