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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative sum

Hello Friends,

I want to show the cumulative sum of headcount(YTD Headacount) month on month increase and decrease in the headcount .

Attached is the sample qvw application for the same.

Scenario:

If i select  year as 2014 then in the Chart Absolute Headcount for the month of Nov and Dec values should be reflected as 14 instead of 5 because  there is no hire and termination in the month of Nov and Dec and in the Month of Oct the headcount was 14 so it should be reflected as YTD headcount.

Please suggest how to get the above output.

7 Replies
anbu1984
Master III
Master III

Your headcount should be 13(16-3). Correct?

=Count({<DateType={'Hire'}, Year={'<=$(=Year)'}>}EmpID) - Count({<DateType={'Term'}, Year={'<=$(=Year)'}>}EmpID)

Not applicable
Author

Hello Anbu,

Yes you are right ,at the end i should have 13 but When i am selecting year as 2014  then

Jan headcount should be headcount as of 31/12 /2013 + Net joiner /leavers of Jan 2014,

Feb headcount should be jan 2014 result +  Net joiner /leavers of Feb 2014,

Mar headcount should be Feb2014 + Net joiner /leavers of Mar 2014 and so on.

which i am not able to get from the above expression.

anbu1984
Master III
Master III

Above expr gives 13. Check this app

Not applicable
Author

I am getting 13 in the chart Absolute Headcount in the Month of Oct.
I want to show the same 13 value in the month of Nov and Dec also,

as there is no hires and terminations in the month of Nov and Dec of 2014.

So the headcount at the end of Dec 2014 will be 13.

By using the above expression i am only getting the Net result.

I want to show the month on month Headcount Movement.

anbu1984
Master III
Master III

If(sum(Aggr(vOpHeadCountSelYear, Month)),sum(Aggr(vOpHeadCountSelYear, Month)),Above(Column(1)))

Not applicable
Author

I want to show the growth ,month on month

Expected Output for Year  2014:

MonthHeadCount
Jan6
Feb7
Mar8
Apr8
May8
Jun9
Jul11
Aug11
Sep12
Oct13
Nov13
Dec13

In your expression i am getting 13 for all the months.

anbu1984
Master III
Master III

Check this

=Count(TOTAL {<DateType={'Hire'}, Year={'<$(=Year)'}>}EmpID) - Count(TOTAL {<DateType={'Term'}, Year={'<$(=Year)'}>}EmpID)

+ RangeSum(Above(Count({<DateType={'Hire'}>}EmpID),0,RowNo())) - RangeSum(Above(Count({<DateType={'Term'}>}EmpID),0,RowNo()))