Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
MVP
MVP

looking for this?

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

sunny_talwar

Another option

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

swuehl
MVP
MVP

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

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
Specialist II
Specialist II

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.