Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

msj_telstra
New Contributor

How to count with fields = and <> to?

I am trying to count the number of employees using Employee No. based on location and employee category. There are a number of locations and categories. I can count the number of employees that are in 1 location and 1 category but how do I count the number of employees in 1 location and many categories or many locations and 1 category? Note: each employee will only appear in 1 location and 1 category so distinct is not required.

This works

[Main work address - Country]={'Australia'}, [ContCat]={'Employees-other'}>} [Employee no.])

But this doesn't

[Main work address - Country]={'Australia'}, [ContCat]<>{'Employees-other'}>} [Employee no.])

5 Replies
Chanty4u
Esteemed Contributor III

Re: How to count with fields = and <> to?

looking for this?

[Main work address - Country]={'Australia'}, [ContCat]-={'Employees-other'}>} [Employee no.])

Re: How to count with fields = and <> to?

Another option

[ContCat] = e({<[ContCat] = {'Employees-other'}>})

MVP
MVP

Re: How to count with fields = and <> to?

Mark, the equal sign is more an assignment operator rather than a comparison operator, that's basically why <> is not allowed here.

Here is an overview of options for your request:

Excluding values in Set Analysis

OmarBenSalem
Esteemed Contributor

Re: How to count with fields = and <> to?

Sunny, this e() and $:: have always been my nemesis ! I can't figure out a simple way to understand their use;

Can u please give 2 simple, very simple scenarios on where to use these and the result once used?

dwforest
Valued Contributor

Re: How to count with fields = and <> to?

Short answer:

e() excludes the values in the set from the result; so in your example it excludes ContCat records with a value of 'Employees-other'

$ indicates how the set expression is applied  and it honors any other field selections not explicitly changed by the set expression; so $<Country = 'Australia'> would limit the results to records with Country = 'Australia' and any other selections, e.g. if Year has selected values of '2018'.

1 by contrast applies the filter absolutely; in the above example, all Years would be included despite the user having selected 2018.

Community Browser