Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Convert timestamp to Date

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

1 Solution

Accepted Solutions
sunny_talwar

Try this:

SET DateFormat='YYYY-MM-DD';

LOAD Date(Date#(Left(Date, 10), 'YYYY/MM/DD')) as Date, 

     [peakCpuUsage (avg)],

     [averageCpuUsage (avg)],

     ENTRY

FROM

[http://aa352biproc2.tcad.telia.se:8080/UniverseBridge/Results?baseURL=http%3A%2F%2Faa352biproc2.tcad...]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

View solution in original post

3 Replies
sunny_talwar

Try this:

SET DateFormat='YYYY-MM-DD';

LOAD Date(Date#(Left(Date, 10), 'YYYY/MM/DD')) as Date, 

     [peakCpuUsage (avg)],

     [averageCpuUsage (avg)],

     ENTRY

FROM

[http://aa352biproc2.tcad.telia.se:8080/UniverseBridge/Results?baseURL=http%3A%2F%2Faa352biproc2.tcad...]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

swuehl
MVP
MVP

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