Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I am working on a job and i don't understand my out data because after many tests everything look good.
I have an input file with a date column and objective is to classify all rows by month
Example:
Input file with date MM/dd/yyyy
MLarronde;10/05/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
MLarronde;10/06/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
MLarronde;10/31/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
MLarronde;10/01/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
svautrot;09/15/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED
svautrot;09/16/2015;WHO;Testing support;Billable;ACCEPTED
svautrot;09/16/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED
svautrot;09/01/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED
With these inputs i get this output
Output file for previous month (October)
MLarronde;10/05/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
MLarronde;10/06/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
Output file for month September
svautrot;09/15/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED
svautrot;09/16/2015;WHO;Testing support;Billable;ACCEPTED
svautrot;09/16/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED
Screenshot of my tMap
First i generate 2 variables which are FirstDay_currentDate and LastDay_currentDate
FirstDay_currentDate expression
==> TalendDate.getFirstDayOfMonth(TalendDate.getCurrentDate())
LastDay_currentDate expression
==> TalendDate.getLastDayOfMonth(TalendDate.getCurrentDate())
For October output file, i do this condition:
TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.FirstDay_currentDate,-1,"MM")) >= 0 &&
TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.LastDay_currentDate,-1,"MM")) <= 0
And for September output file, i do this condition:
TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.FirstDay_currentDate,-2,"MM")) >= 0 &&
TalendDate.compareDate(row24.activityDate,TalendDate.addDate(Var.LastDay_currentDate,-2,"MM")) <= 0
Please help me solve this problem, because i don't know why i don't get blue rows
MLarronde;10/31/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
MLarronde;10/01/2015;Parrot;Parrot EPM & COMP;Billable;ACCEPTED
svautrot;09/01/2015;Bureau Veritas;Bureau Veritas - LMS ILT;Billable;ACCEPTED
Thanks,
TalendDate.getFirstDayOfMonth(TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd", TalendDate.getCurrentDate())))
TalendDate.getFirstDayOfMonth(TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd", TalendDate.getCurrentDate())))