Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Easy Question on Counting Instances of a Field

Please excuse the simplicity of this question, i am just getting started using Qlikview.   I am trying to count the number of unique employees in a record based on their work group.   I can display the data in a table but i want to get a calculated number of employees so that I can use this value in further productivity calculations.   The number of employees in a group changes on a daily basis due to sick time, vacation, etc.

My data shows employee name, work center, and job type.   Example:

Joe           Meter Shop          HIB199

Joe           Meter Shop          HIB199

Joe           Meter Shop         G34555

Mary          Meter Shop         HIB199

Mary          Meter Shop        JZZRT5

James      Cafeteria             T44WTZ

Tim           Cafeteria              T44WTZ

Laura       Cafeteria              T44WTZ

I need to be able to count the number of different employees in each work center.   So Meter Shop = 2 (Joe and Mary) and Cafeteria = 3 (James, Tim, Laura)

I only need the number of employees in a work center, not the number of jobs they complete or the types of jobs.

Thank you.       

1 Solution

Accepted Solutions
mayilvahanan
Not applicable

Re: Easy Question on Counting Instances of a Field

Hi,

     Use distinct count, that helps to achieve your requirement..

4 Replies
mayilvahanan
Not applicable

Re: Easy Question on Counting Instances of a Field

HI,

     You can use like this,

     =WorkCenter as Dimension and Count(Distinct Name) as Expression

     Hope it helps

Not applicable

Re: Easy Question on Counting Instances of a Field

Unfortunately that does not work.  That result is just the number of jobs each tech does.

Using:

Work Center Scheduled as the  Dimension   

count([Employee Scheduled])  as the Expression

That will result in 5 for Meter Shop and 3 for Cafeteria.   It just counts the instances in each Work Center Schedule or in this case the number of jobs.

Do i need to add Distinct to my count?   The Employee Scheduled field is unique to each Work Center (ie, an employee can only work in one group) but there can be multiple instances of an employee since they do multiple tasks per day.  

mayilvahanan
Not applicable

Re: Easy Question on Counting Instances of a Field

Hi,

     Use distinct count, that helps to achieve your requirement..

Not applicable

Re: Easy Question on Counting Instances of a Field

Thank you very much - it worked when i used:

count(Distinct([Employee Scheduled]))