Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I need your help.
I have attached the file in that I have Month field like April'13 but i want that in Date format like Apr 2013.
How can I convert that in date format.
Please help.
Thanks In Advance.
-Neha
Hi Neha,
In load script, let add new field with below code
| Date(Date#(Replace(YourDateField,Chr(39),'-'),'MMMM-yy'),'MMM yyyy') | AS NewDateField |
Regards,
Sokkorn
left(Month,len(Month)-3)&' '& Right(Month 2) as Month in script
or use in dimension with "as Month"
hope this helps
Hi Neha,
In load script, let add new field with below code
| Date(Date#(Replace(YourDateField,Chr(39),'-'),'MMMM-yy'),'MMM yyyy') | AS NewDateField |
Regards,
Sokkorn
First, you need to define the long Month name in the environment:
SET LongMonthNames = 'January;February;March;April;May;June;July;August;September;October;November;December';
Then you can use this in your format code as MMMM. So, in the script you should have
Date#(Month,'MMMM''YY') as Month2,
HIC
Hello,
Try this
Date(Date#(YourDateField,'MMM'&chr(39)&'YY'),'MMM yyyy') as newDate
Hi Neha,
You can use following Code to achieve the result.
Date(Date#(Month,'MMM'&chr(39) &'YY'),'MMM YYYY') as YearMonth
-Regards,
Kiran
Hi Sunil,
I have did this. but its not useful in my application as i need it in date format and here it will give in string format.
Thanks for the reply.
-Neha