Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have to calculate how many years working, i am using AGE function.
like Age(DOJ, Resignation_Date)
Sample Example..
this is my table i want to exclude 0-3 months Experience.. persons
i want to calculate only 4 moths to upper experence....
EmpName DOJ Resignation Date
| Raju | 16/10/2013 | 10/02/2014 |
| sunil | 06/02/2012 | 07/03/2012 |
| sampath | 17/11/2014 | 17/11/2014 |
| reddy | 14/09/2009 | 18/10/2012 |
| amith | 12/03/2014 | 01/08/2014 |
| sandya | 19/04/2010 | 27/11/2012 |
| Apporv | 25/08/2014 | 29/08/2014 |
| Sameer | 03/10/2011 | 26/04/2013 |
| Akil | 12/01/2009 | 26/07/2012 |
| Nitya | 13/12/2010 | 27/05/2013 |
| Satya | 03/08/2009 | 15/05/2013 |
| Viktanth | 07/07/2011 | 22/10/2013 |
| santu | 20/01/2014 | 03/11/2014 |
| banti | 23/04/2009 | 23/04/2012 |
Hope you Undersatand .......!!!!
Thanks in Advance......
The most simple thing would be if you used 90 days instead of 3 months as the condition. Then it's a really simple Where clause to add at the end of the Load statement:
WHERE ResignationDate - DOJ > 90
Hi,
use Interval([Resignation Date]-[DOJ ]) as Days
if you want more than 3 months of employee then use this code
if(Days/30<=3,'0',1) as flag
0 is less than or equal to 3 months experience and 1 is more than than 3 months experience.
Regards
Vimlesh
Try this
if(NetWorkDays(DOJ,Resignation_Date)>90,1,0) as flag
And use flag=1 in your chart
Table:
Load
*
Where Days > 30;
Load
EmpName,
Date(DOJ) as DOJ,
Date([Resignation Date]) as [Resignation Date],
Interval([Resignation Date] - DOJ,'DD') as Days
Inline
[
EmpName, DOJ, Resignation Date
Raju, 16/10/2013, 10/02/2014
sunil, 06/02/2012, 07/03/2012
sampath, 17/11/2014, 17/11/2014
reddy, 14/09/2009, 18/10/2012
amith, 12/03/2014, 01/08/2014
sandya, 19/04/2010, 27/11/2012
Apporv, 25/08/2014, 29/08/2014
Sameer, 03/10/2011, 26/04/2013
Akil, 12/01/2009, 26/07/2012
Nitya, 13/12/2010, 27/05/2013
Satya, 03/08/2009, 15/05/2013
Viktanth, 07/07/2011, 22/10/2013
santu, 20/01/2014, 03/11/2014
banti, 23/04/2009, 23/04/2012
];
If you want to use 3 Months instead of 90 days, use as below
Table:
Load
*
Where Months > 3;
Load
EmpName,
Date(DOJ) as DOJ,
Date([Resignation Date]) as [Resignation Date],
(Year([Resignation Date]) * 12 + Month([Resignation Date])) - (Year(DOJ) * 12 + Month(DOJ)) as Months
Inline
[
YourData
];
Hi, manish solution is awsome as per my view.
Hi,
Check this link for getting months difference
Calculating Months difference between two dates
Follow the above above post and use below script
Data:
LOAD
*
WHERE MonthsDifference > 3;
LOAD
EmpName,
DOJ,
ResignationDate,
($(MonthDiff(DOJ, ResignationDate)) AS MonthsDifference
FROM DataSource;
Hope it helps you.
Regards,
Jagan.