Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have a file where the period is stored as YYYYMM (e.g.201304).
I want to change this into a date field where I can then later on also calculate MAT, YTD, etc.
Do you have any advice what and how to do?
thank you
Hi,
Date#(fieldname) as Date
Narender
Add the following to you script:
SET DateFormat='YYYYMM';
And then use the date# function to separate it.
The following example works:
eg.
DateYear:
LOAD* Inline [
YYYYMM, Value
201304, 1
201201, 2
];
Load YYYYMM,
Date#(YYYYMM) as DDate,
Month(Date#(YYYYMM)) as DMonth,
Year(Date#(YYYYMM)) as DYear
Resident DateYear;
Hope it will help u..
Date(MakeDate(Left(period,4),Right(period,2),'01'),'DD/MM/YYYY') as DATE
Regards-Bika
This was working, but only with 'MM/YYYY' instead of 'DD/MM/YYYY'
thank you
Hi,
DATE (MakeDate(LEFT(YYYYMM,4),RIGHT(YYYYMM,2),'01'),'DD/MM/YYYY') AS DATE
Regards
Neetu