Discussion board where members can learn more about Qlik Sense Data Connectivity.
I have a date string in a CSV field that I currently have labeled as "Send Date" and looks like this:
9/24/2015 9:01:00 AM
I want to be able to split this date string into two fields:
9/24/2015 as "Date Sent"
9:01:00 AM as "Time Sent"
Currently my data load script looks like this:
"Times Liked on Facebook",
FROM [lib://Newsletter Data/Sep_25_2015.csv]
(txt, utf8, embedded labels, delimiter is ',', msq);
What do I need to add in order to get the date/time split I want from my source data?
Try subfield() function.
subfield([Your Field],' ',1) as Date,
subfield([Your Field],' ',2) as Time,
View solution in original post
Date(Floor([Send Date])) As [Send Date],
Time(Frac([Send Date])) As [Send Time],
This assumes that the [Send Date] field is being recognised as a date time (numeric) and not as a string. If [Send Dat] is a string (left aligns in a list box), then you need:
Date(Floor(Timestamp#([Send Date], 'M-D-YYYY h:mm:ss TT'))) As [Send Date],
Time(Frac(Timestamp#([Send Date], 'M-D-YYYY h:mm:ss TT'))) As [Send Time],
Tweak the format string in bold so the date and time are being correctly populated.
I have executed