Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi friends,Have a Nice Day Can any one please help on below logic
I have a Column with name Period Consists of Date as 201409=>Here Format is YYYYMM (2014(YYYY),09(MM))
I'm Trying to Incorporate the Make date function to Get Month Start,Month End for Associations 0n Period Column
But Fail to achieve this File Not Found Period Like Error showing But Values are Present in above format.
Temp:
LOAD Period,
MakeDate(mid(Period,1,4),Right(Period,2),'01') as Monthstart,
MakeDate(mid(Period,1,4),Right(Period,2),
IF(Right(Period,2)='01','31',
if(Right(Period,2)='02','28',
if(Right(Period,2)='03','31',
if(Right(Period,2)='04','30',
if(Right(Period,2)='06','30',
if(Right(Period,2)='07','31',
if(Right(Period,2)='08','31',
if(Right(Period,2)='09','30',
if(Right(Period,2)='10','31',
if(Right(Period,2)='11','30',
if(Right(Period,2)='12','31',
if(Right(Period,2)='05','31','01'))))))))))))) as Monthend
Resident [Check];
Need to Achieve This Period,Monthstart,Monthend
Use the script below
Data:
LOAD *,MonthStart(Date) as MonthStartDate, MonthEnd(Date) as MonthEndDate;
LOAD *,MakeDate(Left(Period,4),Right(Period,2),1) as Date;
LOAD * Inline [
Period
201401
201402
];
LOAD *,
DayName(MonthEnd(MonthStartDate)) as MonthEndDate;
LOAD Period,
Date#(Period,'YYYYMM') as MonthStartDate
Inline [
Period
201401
201402
];
Hi,
Try:
Data:
LOAD * Inline
[
Period
201401
201402
201403
];
LOAD *,
MonthStart(Date) as MonthStartDate,
MonthEnd(Date) as MonthEndDate;
LOAD *,Date#(Period,'YYYYMM') as Date
Resident Data;
Regards
Neetha