Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have a requirement like,i want to find the no of employees count (Joining &Leaving)
Employee ID | Joining Date | Leaving Date |
---|---|---|
1111 | 12-Jan-2010 | 13-Feb-2011 |
1112 | 12-Jan-2010 | 13-Feb-2011 |
1113 | 12-Feb-2011 | 12-Feb-2012 |
1114 | 12-Feb-2011 | 12-Feb-2012 |
1115 | 14-Mar-2013 | 14-Apr-2014 |
1116 | 15-Apr-2013 | 16-Apr-2014 |
Thanks,
Rao
I don't think this is the best forum for this question. A better place to start is one of the forums/places that do not focus on the QDF. Eg: New to QlikView I believe the response time in these forums are a lot faster than in here.
Howerer, the question is posted and I'll try to help you. I think you should take a look into a feature called intervalmatch(), I think it will help you to fill this requirement. Take a look at Henric Cronström blogpost
http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch
Cheers
egbs consulting ab
Considering that you want to know the number of employees Joining and Leaving Month Wise... Use below in your script...
=================================
Employee:
Load
[Employee ID],
Date(Date#([Joining Date],'DD-MMM-YYYY')) as [Joining Date],
Date(Date#([Leaving Date],'DD-MMM-YYYY')) as [Leaving Date]
Inline
[
Employee ID, Joining Date, Leaving Date
1111, 12-Jan-2010, 13-Feb-2011
1112, 12-Jan-2010, 13-Feb-2011
1113, 12-Feb-2011, 12-Feb-2012
1114, 12-Feb-2011, 12-Feb-2012
1115, 14-Mar-2013, 14-Apr-2014
1116, 15-Apr-2013, 16-Apr-2014
];
Joining:
Mapping Load
[Employee ID],
[Joining Date]
Resident Employee;
Leaving:
Mapping Load
[Employee ID],
[Leaving Date]
Resident Employee;
DateBridge:
Load
[Employee ID],
ApplyMap('Joining',[Employee ID],Null()) as Date,
'Joining' as DataType
Resident Employee;
Load
[Employee ID],
ApplyMap('Leaving',[Employee ID],Null()) as Date,
'Leaving' as DataType
Resident Employee;
Join
Load
[Employee ID],
Date,
Month(Date) as Month
Resident DateBridge;
================================
Now create a Straight Table
Dimension
Month
Expression
For Employee Joining...
COUNT({<DataType = {'Joining'}>}DISTINCT [Employee ID])
For Employee Leaving...
COUNT({<DataType = {'Leaving'}>}DISTINCT [Employee ID])
Hi Manish,
Thanks for the information,The count is working.
Thanks & Regards,
Rao.
Can you please close the thread by selecting appropriate answer?