Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
apsingh27108
Contributor
Contributor

Hi, I'm looking for help with conditional count expression

I have two data columns - EmployeId and EmployeM

I'm looking to get count of all the Employee who are not manager.


Thanks for the help

2 Replies
devarasu07
Master II
Master II

Hi,

can u share the mock data and expected results,

u can do multiple way,

1) using set analysis (assume title field contain the employ role desc. u can exclude like below

count(distinct  {$<Title-={'*Manager*'} >EmployeId)

or

Count( distinct {$<EmployeM-={'Manager'}>} EmployeId)


2) conditional if count


3) back end script etc


refer to the sample attached,

Capture.JPG

Thanks

Deva

ericasense
Contributor III
Contributor III

You can use the P() function within set analysis to return a sub set of items to filter on

=count({<EmployeId= p( EmployeM)>} distinct EmployeId)


Will return a (distinct) count of employees that are managers. Putting a "-" before the "=" sign will now exclude all the managers.


=count({<EmployeId -= p( EmployeM)>} distinct EmployeId) is probably what you need.


Check out the full documentation for set analysis, if you haven't used it before it's a really powerful tool!

Set analysis and set expressions ‒ QlikView


Erica