Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
subbareddykm
Creator II
Creator II

active employee count

Hi All,

I have one requirement, where i have to count Active on year basis.

But in my case , i have created year and month field in data . i ahve used year filter in dimentions and Expressiomn as Count(Emp)

It is giving me only Active employees in that year only but i want as of respective year.

but if create expression for every year wise and filter data field then it giving me correct and also later want create for Year wise month too.

How can i achieve this?

10 Replies
rahulpawarb
Specialist III
Specialist III

Hello Subbareddy,

Please refer below given draft expression:

//Considering Year dimension is used in filter

Count({<Year={"<= $(=Max(Year))"}>}Emp)

//Considering Year dimension is used in filter

//If you identify an employee is an active based on flag IsActive (1-Active/0-Inactive)

Count({<Year={"<= $(=Max(Year))"}, IsActive={'1'}>}Emp)

Hope this will be helpful.

Regards!

Rahul

silambarasan
Creator II
Creator II

How do you identify the active employee?

subbareddykm
Creator II
Creator II
Author

I have a flag for it

silambarasan
Creator II
Creator II

count({<Flag={1}>}emp)

1 is active

0 is Inactive

subbareddykm
Creator II
Creator II
Author

Its not working rahul,

its giving only for that year only.

Let me create sample data for it ,it will be helpful to work on it

rahulpawarb
Specialist III
Specialist III

Thank you If possible please share the application with sample data.

subbareddykm
Creator II
Creator II
Author

Let me explain the scenario,

For example

now we are in 2017 year, If we check active Emp let say 1550.in this if i apply only active Filter then i will get only for 2017 but i want for <=today.

and if we are in 2016 , 2016 max date we have to consider and same like above.

i hope you understand.

ganeshsvm
Creator II
Creator II

Hi,

Providing sample data and your required result in Excel would be easy for us to evaluate the result for you.

-Ganesh

ajsjoshua
Specialist
Specialist

Hi,

Try this

  1. Count({$<Date={"<= $(=Date(Max(Year)))"}, IsActive={'1'}>}Emp) 
  2. Count({<Date={"<= $(=Date(Max(Year)))"}>}Emp)