Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count in Script # times Employee Name appears as Manager Name

Hi there, I suspect this is easier than I think it is!

I have a standard Headcount table including Employee_Name and Manager_Name fields.

I want to Join to this a Reportees field capturing the number of times each Employee_Name appears as a Manager_Name.

If it were Excel it would be a simple CountIf(range = Manager_Name column, condition = This Employee_Name)

Can anyone help me with this?

Thanks - Mike

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Headcount:

LOAD Employee_Name,

           Manager_Name

FROM ....

Left Join (Headcount)

LOAD Manager_Name as Employee_Name,

           Count(Manager_Name) as Count

Resident Headcount

Group By Manager_Name;

View solution in original post

4 Replies
Anil_Babu_Samineni

Perhaps This,

CountIf(range = Manager_Name column, condition = This Employee_Name)


Count({<range = {'$(=Only(Manager_Name))'}>}Employee_Name)

OR

Count({<range = P(Manager_Name)>}Employee_Name)

OR

Count({<range = $::Manager_Name}>}Employee_Name)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be like this:

Headcount:

LOAD Employee_Name,

           Manager_Name

FROM ....

Left Join (Headcount)

LOAD Manager_Name as Employee_Name,

           Count(Manager_Name) as Count

Resident Headcount

Group By Manager_Name;

Not applicable
Author

Worked like a charm, thanks very much!

sunny_talwar

Awesome!! I am glad it did. I would suggest you to close this thread by marking correct and/or helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny