Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have in date in Excel like
STARTDATE ENDDATE
27/03/2016 31/05/2016
I need output like
Follow this.
I just added Years if you want to add Months please change that and let me know
- Anil Chowdary
Hi Mahesh ,
if your dates are missing then you have to find missing dates between min and max date with loop and min - max variable - this link will help to understand this proccess - Creating A Master Calendar
Hi Anil
I Don't want Missing Dates This is my input:-
I have in date in Excel like
STARTDATE ENDDATE
27/03/2016 31/05/2016
Here April month data is not there but i need output given below like this.
Expected output:-
Date:-
2016_Mar
2016_Apr
2016_May
For End Date
=date(date#(ENDDATE,'DD/MM/YYYY'),'YYYY')&'_'&date(date#(ENDDATE,'DD/MM/YYYY'),'MMM')
Output:
End_date:
=date(date#(ENDDATE,'DD/MM/YYYY'),'YYYY')&'_'&date(date#(ENDDATE,'DD/MM/YYYY'),'MMM')
Start_date:
=date(date#(STARTDATE,'DD/MM/YYYY'),'YYYY')&'_'&date(date#(STARTDATE,'DD/MM/YYYY'),'MMM')
Hi Varsha,
I done like this
DATE(Date#(STARTDATE,'DD/MM/YYYY'),'YYYY_MMM') as STARTDATE,
DATE(Date#(ENDDATE,'DD/MM/YYYY'),'YYYY_MMM') AS ENDDATE,
I got like this
STARTDATE ENDDATE
2016_Mar 2016_May
Here I don't have April data I want April month also below like this.
But I need output :-
Date:-
2016_Mar,
2016_Apr,
2016_May
Regards,
Mahesh
Mahesh,
Did you try my attachment.
I'm sorry.
I missed out April.
I will try and let you know
Not sure if you just want this for representation of these two dates only -
Hi Mahesh,
See this code:
Data:
LOAD *,
Date(DateInc) as Date;
LOAD * INLINE [
DateInc, Value
01/05/2016, 10
01/06/2016, 20
01/08/2016, 50
];
LEFT JOIN
LOAD
Date,
If(IsNull(Previous(Date)),'31/12/2016',
Previous(Date)-1) as PrevDate
RESIDENT Data
ORDER BY Date DESC;
Calendariced:
Load *,
Month(Date) as Month,
Year(Date) as Year,
MonthName(Date) as MonthYear;
LOAD
Value,
Date + Iterno()-1 As Num,
Date(Date + IterNo() - 1) as Date
RESIDENT Data
While Date + IterNo() -1 <= PrevDate;
DROP TABLE Data;
EXIT Script;
Regards!