Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi friends, i need your expertise help.
I have a calendar with daily target (in hours) for our employees. But i need to remove the targets until Hiring Date.
For example, [Employee ID 001] have "-8" for each daily target, and him [Hiring Date]=11/11/2016. In this case i need to remove the targets between 01/11/2016 to 11/11/2016
I tried with
FOR i = 1 to FieldValueCount('[Employee ID 001]')
LET vGIN = FieldValue('[Employee ID 001]', $(i));
LOAD
num(makedate(2016,$(vMonth))) + iterno() -1 as Date
autogenerate(1)
while makedate(2016,$(vMonth)) + iterno() -1 < [Hiring Date];
NEXT i
but .... i cant
Any help please, Thanks in advanced!!!
Try this
employee:
LOAD * INLINE [
Employee ID, Hiring Date
001, 11/11/2016
002, 02/11/2016
003, 14/11/2016
004, 07/11/2016
];
//********* MAKE CALENDAR
Calendar_temp:
LOAD
Date(makedate(2016,11) + iterno() -1) as Date
autogenerate(1)
while makedate(2016,11) + iterno() -1 < makedate(2016,12);
join(employee) LOAD *,'-8' as DailyTarget Resident Calendar_temp;
DROP Table Calendar_temp;
NoConcatenate
Employee_New:
LOAD [Employee ID],
[Hiring Date],
Date,
if(Date<=[Hiring Date],Null(),DailyTarget) as DailyTarget
Resident employee;
DROP Table employee;
Try this
employee:
LOAD * INLINE [
Employee ID, Hiring Date
001, 11/11/2016
002, 02/11/2016
003, 14/11/2016
004, 07/11/2016
];
//********* MAKE CALENDAR
Calendar_temp:
LOAD
Date(makedate(2016,11) + iterno() -1) as Date
autogenerate(1)
while makedate(2016,11) + iterno() -1 < makedate(2016,12);
join(employee) LOAD *,'-8' as DailyTarget Resident Calendar_temp;
DROP Table Calendar_temp;
NoConcatenate
Employee_New:
LOAD [Employee ID],
[Hiring Date],
Date,
if(Date<=[Hiring Date],Null(),DailyTarget) as DailyTarget
Resident employee;
DROP Table employee;
oh my god, i'm dumb... is that easy
Thanks Settu , works perfectly