Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
pthai
Contributor III
Contributor III

Counting Active Employee for 1 year previous

Hello everyone,

Ex:

EMP IDYearDateType
120151/2/2015hire
220157/20/2015hire
320162/3/2016hire
220169/2/2016terminate
320177/3/2017terminate
220178/22/2017hire
2201710/12/2017terminate

 

The result should be:

YearCount of Hire EmployeeCount of Terminate EmployeeCount of Active Employee from 1 year previous
2015202
2016112
2017020

 

For Count of Hire Employee and Count of Terminate Employee,

  • we need to check max date of each year of type 'hire/terminate', then count

For Count of Active Employee from 1 year previous,

  • we need to check max date of current and previous year of type 'hire', then count

 How can we count as result below ? Can we do it in creating measure expresion? Please help!

I also applied https://community.qlik.com/t5/New-to-Qlik-Sense/Active-employee-count-for-specific-year/td-p/1289285...

, but not work

5 Replies
pthai
Contributor III
Contributor III
Author

Hello!

Anyone? Pleasee

Almen
Creator II
Creator II

I'm not sure I understand your output correctly.  You show one hired EMP in 2017 and one active from 2015, yet your sum of active EMP is only 1? Also, do you re-use the EMP_ID because ID 2 is hired, terminated and hired again.

pthai
Contributor III
Contributor III
Author

Thanks for your response.

We calculate for the current and previous year

For example: 

In 2017 and previous is 2016,

We have: 

  • EMP ID 3 who hired in 2016, but terminated in 2017. So the result is 0.
  • EMP ID 2 who terminated in 2016, but hired in 2017. So the result is 1.

The total will be 1.

vikasmahajan

hi,

you need to use peek & previous function to calculate active employee which quite similar like calculating inventory balance :

see following links :

https://community.qlik.com/t5/QlikView-App-Dev/Opening-Head-Count-Employees-URGENT-Help-required/m-p...

https://community.qlik.com/t5/New-to-Qlik-Sense/Active-employee-count-for-specific-year/td-p/1289285

https://community.qlik.com/t5/New-to-Qlik-Sense/Opening-and-Closing-Balances-per-month/td-p/1379271

https://community.qlik.com/t5/New-to-Qlik-Sense/Extract-daily-data-from-cumulative-data-table-today-...

 

Search for Employee Headcount

Hope this helps you

Thanks

Vikas

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
pthai
Contributor III
Contributor III
Author

Hi Vikasmahajan,

Thank you for your input. I already research your link, but still stuck 😞