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: 
joris_lansdaal
Creator
Creator

Help - Timestamp

Hi all,

in several logfiles I encounter the following Timestamp '20160421T102714.000+0200'.

Currently I have: SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff]';

The problem I have is that I can't convert it to Date, Week, Month... as a matter of fact I can't use it at all.

Any suggestions?

1 Solution

Accepted Solutions
sunny_talwar

Could be the version issue. What about this:

=Date(Floor(TimeStamp#(PurgeChar(Left(EventsTimestamp, 15), 'T'), 'YYYYMMDDhhmmss')))

View solution in original post

19 Replies
sunny_talwar

May be like this:

Date(Floor(TimeStamp(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss')))

Month(Floor(TimeStamp(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss')))

MonthYear(Floor(TimeStamp(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss')))

etc...

MK_QSL
MVP
MVP

dmac1971
Creator III
Creator III

Hi download and study this application :

QlikView How To (or Tips & Tricks) Application

It covers some of the main sticking points when using Qlikview.

Dermot

joris_lansdaal
Creator
Creator
Author

That doesn't work Sunny.

timestamp.PNG

sunny_talwar

My bad, I forgot to add # next to TimeStamp

Date(Floor(TimeStamp#(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss')))

Month(Floor(TimeStamp#(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss')))

MonthYear(Floor(TimeStamp#(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss')))

joris_lansdaal
Creator
Creator
Author

No, same result.

sunny_talwar

Seems to be working for me:

Table:

LOAD *,

  Date(Floor(CalculatedTimeStamp)) as Date,

  Month(CalculatedTimeStamp) as Month,

  Year(CalculatedTimeStamp) as Year,

  MonthName(CalculatedTimeStamp) as MonthYear,

  Time(Frac(CalculatedTimeStamp)) as Time,

  Hour(CalculatedTimeStamp) as Hour,

  Minute(CalculatedTimeStamp) as Minute,

  Second(CalculatedTimeStamp) as Seconds;

LOAD TimeStamp,

  TimeStamp#(Left('20160421T102714.000+0200', 15), 'YYYYMMDDThhmmss') as CalculatedTimeStamp;

LOAD * Inline [

TimeStamp

20160421T101026.000+0200

20160421T101456.000+0200

20160421T101901.000+0200

20160421T102000.000+0200

20160421T102128.000+0200

20160421T102130.000+0200

20160421T102214.000+0200

20160421T102216.000+0200

20160421T102500.000+0200

];

Capture.PNG

joris_lansdaal
Creator
Creator
Author

Am I doing something very wrong......?

table.PNG

sunny_talwar

Can you share the script you used to do this?