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: 
Anonymous
Not applicable

Timestamp format

Hi everybody,

I can't solve my problem with a timestamp. Above you can find my table. The numers are formated as "integer". There you can see that the second column ist not formated in the right way, so I can't calculate the duration.

dates1.png

The script to format the second column is:

   timestamp#(Aufnahme,'DD.MM.YYYY') as Aufnahme_sAufn

ut it seems to be wrong. Why?

How can I format my second date in the correct way?

1 Solution

Accepted Solutions
sunny_talwar

Try this

Date(Floor(TimeStamp#(Aufnahme,'DD.MM.YYYY hh:mm'))) as Aufnahme_sAufn,

Or this

TimeStamp#(Aufnahme,'DD.MM.YYYY hh:mm') as Aufnahme_sAufn,

View solution in original post

5 Replies
sunny_talwar

Try this

Date(Floor(TimeStamp#(Aufnahme,'DD.MM.YYYY hh:mm'))) as Aufnahme_sAufn,

Or this

TimeStamp#(Aufnahme,'DD.MM.YYYY hh:mm') as Aufnahme_sAufn,

prieper
Master II
Master II

timestamp# reads a given string in the format specified incl the delimiters, so should be

timestamp#(Aufnahme, 'DD.MM.YYYY hh:mm').

This usually should end as a decimula number  eg 42950.15.

In order display this as a timestamp you need to enclose this function with the timestamp-function:

timestamp(timestamp#(Aufnahme, 'DD.MM.YYYY hh:mm'))      - this may display in the current timestamp settings

timestamp(timestamp#(Aufnahme, 'DD.MM.YYYY hh:mm'), 'DD.MMM.YY hh:mm:ss') - to use any format of your own

Kushal_Chawda

Your Date is in text format. You can do something like below

In your script, main tab, change below set variable

SET TimestampFormat='DD.MM.YYYY hh:mm';

then use below


date(floor(Aufnahme),'DD.MM.YYYY') as Aufnahme_sAufn,

Anonymous
Not applicable
Author

timestamp#(Aufnahme, 'DD.MM.YYYY hh:mm' is not working, but the other two Versions!

Thankx!!!

Anonymous
Not applicable
Author

Correct! This works, too!

Thank you!