Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Timestamp not working

So here is what happens,

Initial Data format

2010-12-05T00:30:00-05:00 so YYYY-MM-DDTHH:MM:SS-AA:BB

here is the code that I used

Timestamp#(left(replace(StartAt, 'T', ' '),19), 'YYYY-MM-DDhh:mm:ss.fff') as MyTimeStamp,

^^ this works as I can see expected result in list box

and then when I do (all of them do not work)

=Hour(MyTimeStamp)

=Floor(MyTimeStamp)

in expression for the title, or even in the load statement,I do not get the expected result !

Please help !

Thank you.

1 Solution

Accepted Solutions
Not applicable
Author

As suggested above,

this code worked for me :

TimeStamp(Timestamp#(left(replace(StartAt, 'T', ' '),19), 'YYYY-MM-DD hh:mm:ss[.fff]') ,'YYYY-MM-DD hh:mm:ss[.fff]') AS MyTimeStamp

Thank you for your help.

View solution in original post

4 Replies
MayilVahanan

HI

Try like this

TimeStamp(Timestamp#(left(replace(StartAt, 'T', ' '),19), 'YYYY-MM-DDhh:mm:ss.fff') ,'YYYY-MM-DDhh:mm:ss.fff') AS MyTimeStamp;


Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
CELAMBARASAN
Partner - Champion
Partner - Champion

You should use Timestamp function around the TimeStamp#

TimeStamp(Timestamp#(StartAt 'YYYY-MM-DDThh:mm:ss.fff') ,'YYYY-MM-DDhh:mm:ss.fff') AS MyTimeStamp;

if your splitting for some other string the use Left(StartAt, 20) in the place of StartAt

Not applicable
Author

Now nothing is working ! the listbox doesn't show dates any more for the field MyTimeStamp

Not applicable
Author

As suggested above,

this code worked for me :

TimeStamp(Timestamp#(left(replace(StartAt, 'T', ' '),19), 'YYYY-MM-DD hh:mm:ss[.fff]') ,'YYYY-MM-DD hh:mm:ss[.fff]') AS MyTimeStamp

Thank you for your help.