Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

neetha_p
Honored Contributor

Active headcount overtime

Hi All,

Please help needed for active headcount for past 12 months.

Active employee overtime.PNG

Below is my expression:

=Count({<[HIRE DATE] = {"<=$(=AddMonths(MonthStart(Today()),-13))"}, [TERMINATION DATE]= {">=$(=AddMonths(Monthend(Today())))"} >}[EMP COUNT])+
(
Count({<[HIRE DATE] = {"<=$(=AddMonths(MonthStart(Today())))>=$(=AddMonths(Monthend(Today()),-12))"},[HIRE COUNT] = {'1'} >}[EMP COUNT])-
Count({<[TERMINATION DATE] = {"<=$(=AddMonths(MonthStart(Today())))>=$(=AddMonths(Monthend(Today()),-12))"},[TERMINATION COUNT] = {'1'} >}[EMP COUNT]))

Getting wrong headcount.

please see attached QVW

Thanks

neetha

11 Replies

Re: Active headcount overtime

What are you expecting to see? Do you know where the issue might be from your initial investigation?

neetha_p
Honored Contributor

Re: Active headcount overtime

Hi Sunny,

Thanks for quick response.

I want overall headcount for every month, add hires and subtracting terminations.

The logic I tried is wrong I feel, it gives in thousands  ,where It should be over 1 lakh or more for each month.

Thanks

Neetha

Re: Active headcount overtime

Have you looked at each of the three expressions individually and tried to see if one of them is acting weird or if all of them seem incorrect? The problem is that from the looks of it, your expression looks right. I don't see any issue with them. So unless I have a sample to look at, I will only be able to guide you and not provide anything concrete.

Re: Active headcount overtime

One thing you can check is if your set analysis is in the same format as HIRE DATE? May be add this to a text box object -> =AddMonths(MonthStart(Today()),-13) and see if it is in the same format as HIRE DATE or not. If it isn't then add a Date() function with the matching format in all your set analysis

neetha_p
Honored Contributor

Re: Active headcount overtime

Hi Sunny,

Please give your mailid.

Thanks Neetha

Re: Active headcount overtime

Hi Neetha,

As sunindia‌ suggested try to break our expression into 3 part and then check if everything i fine....then combine the expressions

<=$(=AddMonths(MonthStart(Today()),-13))"},[TERMINATION DATE]= {">=$(=AddMonths(Monthend(Today())))"} >}[EMP COUNT])+

// is this portion is rite it should be

> than 12 month and less than today !

>=$(=AddMonths(MonthStart(Today()),-13))"},[TERMINATION DATE]= {"<=$(=AddMonths(Monthend(Today())))"} >}[EMP COUNT])

neetha_p
Honored Contributor

Re: Active headcount overtime

Hi Avinash,

Thanks for reply.

Requirement - Whole HC Based on MonthYear dimension for last 12 months.

for each data point it should give total active headcount for that month.

which I am not getting.

Thanks & Regards

Neetha

Re: Active headcount overtime

Hi,

please post example applications in your thread instead of mailing them to individual community members, so others can follow and learn.

Maybe this post helps:

Preparing examples for Upload - Reduction and Data Scrambling

thanks

regards

Marco

neetha_p
Honored Contributor

Re: Active headcount overtime

HI Marco,

I have attached QVW .

Please look at it.

Thanks

Neetha

Community Browser