Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Make Calendar

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!!!

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

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;

View solution in original post

2 Replies
settu_periasamy
Master III
Master III

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;

Not applicable
Author

oh my god, i'm dumb... is that easy

Thanks Settu , works perfectly