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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum occurrences of a value

Hello,

I am trying to make a table which sums the number of employees in each department. The data is loaded from an Excel spreadsheet with the following relevant columns:

DepartmentEmployeeID
Bygg478
Bygg286
Grunnarbeid500
Grunnarbeid280
Bygg337
Bygg341
Økonomi, personal og IKT430
Maskin og lager358
ingen999
Bygg240
Økonomi, personal og IKT123
Grunnarbeid408
Grunnarbeid484
Anlegg og VA426
Bygg359
Park og miljø378
Oppmåling416
Mekanisk428
Grunnarbeid471
Grunnarbeid468
Bygg440
Bygg438
Bygg476
Anlegg og VA356
Park og miljø182

How can I do this?

Thanks!

1 Solution

Accepted Solutions
slange2901
Contributor
Contributor

Hello robertfoss,

you have to use the count & distinct: count(DISTINCT EmployeeID).

gr

View solution in original post

4 Replies
Not applicable
Author

Hello,

You can use a striaght table or a bar chart for this.

Add Department as dimension and use expression as count(EmployeeID).

Please refer the attached sample.

Hope it helps.

Regards,

-Khaled.

Not applicable
Author

Thanks,

However, I forgot to mention one important detail.

The EmployeeID can contain multiple duplicate values, so what I really need is to Count the number of unique values, not the total number of values.

slange2901
Contributor
Contributor

Hello robertfoss,

you have to use the count & distinct: count(DISTINCT EmployeeID).

gr

Not applicable
Author

Just add the distinct keyword in the expression. ...so it would be

something like count ( distinct EmployeeID)....

Hope it helps.

Regards,

-Khaled.