Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i have a date formate of this type CD(2014-06-10 00:07:51.63) . I wanted to know how do i get the month and year out of this .
I tried with the following expression but its not working year(CD) as year .
Thanks in Advance
Hi,
Try like this,
year(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as Year
Month(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as Month,
MonthName(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as MonthName,
Day(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as Day,
Regards
Hi,
Try this ways
Tab1:
LOAD Datetime,
Mid(Datetime,4,4) as Year,
Mid(Datetime,9,2) as Month,
Mid(Datetime,12,2) as Day;
LOAD * INLINE [
Datetime
CD(2014-06-10 00:07:51.63)
];
Here i assume Mid(Datetime,9,2) as Month, Mid(Datetime,12,2) as Day
Regards
Anand
Is CD field name? Then change arguments in Anand's code
Tab1:
LOAD Datetime,
Mid(Datetime,1,4) as Year,
Mid(Datetime,6,2) as Month,
Mid(Datetime,9,2) as Day;
LOAD * INLINE [
Datetime
2014-06-10 00:07:51.63
];
Hi,
Try like this,
year(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as Year
Month(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as Month,
MonthName(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as MonthName,
Day(TIMESTAMP#(PurgeChar('CD(2014-06-10 00:07:51.63)','CD()'),'YYYY-MM-DD hh:mm:ss.ff')) as Day,
Regards
hi max dreamer you rock man
Hi Wrestler,
Please open single thread for the same question.
This is your open thread
http://community.qlik.com/message/678949#678949
Regards
Anand