Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
In the enclosed qvw i have loaded Date with the format "2016/05/18 00:00:00"
I want to covert this to the format "2016-05-18".
How can this be done in the load script?
/Stefan
Try this:
SET DateFormat='YYYY-MM-DD';
LOAD Date(Date#(Left(Date, 10), 'YYYY/MM/DD')) as Date,
[peakCpuUsage (avg)],
[averageCpuUsage (avg)],
ENTRY
FROM
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Try this:
SET DateFormat='YYYY-MM-DD';
LOAD Date(Date#(Left(Date, 10), 'YYYY/MM/DD')) as Date,
[peakCpuUsage (avg)],
[averageCpuUsage (avg)],
ENTRY
FROM
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Set your default formats to your format used to correctly interpret your timestamps as such:
SET DateFormat='YYYY-MM-DD';
SET TimestampFormat='YYYY/MM/DD hh:mm:ss[.fff]';
Then you can use
DayName(Date) as PureDate
or
= DayName(Date)
in an expression