Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

COUNT Specific Values

Trying to get a total count depending on a specific value within a string . Here is sample data I'm working with:

Manager:                         LOGIN:                      Name:

John Smith                      C0001                        Matt

John Smith                      E0001                        Chris

John Smith                      E0002                        Jack

Jane Anderson                C0002                        Mary

Jane Anderson                E0003                        Pat

Jane Anderson                E0004                        Jamie

I need to count how many contractors (identified by 'c' in login) and employees (identified by 'e' in login) each manager is assigned to. For example, If Jane Anderson was selected it would calculate that there are 2 employees and 1 contractor. How can I write this expression in a Statistics Box or Chart? 

11 Replies
vishsaggi
Champion III
Champion III

Use this?

= 'Contractor Count : ' & Count(IF(Left(Upper(LOGIN), 1) = 'C', 1)) & Chr(13) &

   'Employee  Count : ' & Count(IF(Left(UPPER(LOGIN), 1) = 'E', 1))

Anonymous
Not applicable
Author

yes, that works! thank you!!!