Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have 2 field names with date and time as strings in my basic data as follows: Date 20130405, meaning 2013-April-05 and time as 2015 meaning 8:15pm.
I need to convert these to actual dates(yyyy-mm-dd) in qlikview script and preferably combine them to one field.. How would I do this?
Help much appreciated.
Regards,
Kevin
Timestamp(Timestamp#(Date & ' ' & Time,'YYYYMMDD hhmm'),'YYYY-MM-DD hh:mm') as MyField
See also http://community.qlik.com/blogs/qlikviewdesignblog/2012/06/07/get-the-dates-right
HIC
in text box
=date(Date#('20130415', 'YYYYMMDD') + Time#('2015', 'hhmm'), 'yyyy-mm-dd hh:mm:ss')
in load
load
....,
yourdatefield,
yourtimefield,
date(Date#(yourdatefield, 'YYYYMMDD') + Time#(yourtimefield, 'hhmm'), 'yyyy-mm-dd hh:mm:ss') as newfield
......
from
You can try with the below script also
LOAD *,
Date(Date#(Date,'YYYYMMDD'),'YYYY-MM-DD') as NewDate,
Time(Time#(Time,'hhmm'),'hh:mm') as NewTime,
Date(Date#(Date,'YYYYMMDD'),'YYYY-MM-DD')& ' ' & Time(Time#(Time,'hhmm'),'hh:mm') as NewDateTime,
LOAD * Inline
[
Date,Time
20130405,2015
];
=============
And on front end on any text box write script like
=Date(Date#(20130415,'YYYYMMDD'),'YYYY-MM-DD') &' '& Time(time#(2015,'hhmm'),'hh:mm')
Thanks a bunch!
thanks!
thanks!