Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have date column with Date format as 01-01-2017.I want to get the month and Year out of this and I tried Month(Datefield) ,Year(Datefield) but it is not working.Can anyone help me here ?
Hello,
Try as below:
Month(Date#(Datefield, 'DD-MM-YYYY'))
Year(Date#(Datefield, 'DD-MM-YYYY'))
BR,
Kuba
Try this :
= Month(Date#('01-01-2017', 'DD-MM-YYYY'))
= Year(Date#('01-01-2017', 'DD-MM-YYYY'))
date(MonthStart(date(["YOUR DATA FILED NAME"],'YYYY/MM/DD')),'MMM-YYYY')
If you need the Month and Year simultaneously in your file you can create Day,Month,Year separately in your script like this:
LET vToday=num(today());
LET vMinDate=42370;
LET vMaxDate=num(today());
// Temporary Table
TempCal:
LOAD
date($(vMinDate) +RowNo()) as TempDate
AutoGenerate
$(vMaxDate)-$(vMinDate);
//******************** MASTER CALENDAR**********************
MasterCalendar:
LOAD
TempDate as TRDate,
Year(TempDate) AS Year,
Month(TempDate) as Month,
day(TempDate) as MDay,
Week(TempDate) as Week,
WeekName(TempDate) as WeekName,
Date(MonthStart(TempDate),'YYYYMM') as YearMonth
Resident TempCal;
DROP Table TempCal;
Thanks.