Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fetch time from timestamp

Hi everyone,

I am new to qlikview.I have timestamp value in field as '17-11-2014-00h:42m:21s'

i want to remove the date as well as h,m,s from the time value and only display '42:21'

Thanking u guys in advance.

1 Solution

Accepted Solutions
MarcoWedel

One small suggestion to your solution:

time(frac(timestamp#(purgechar(datefield,'hms'),'DD-MM-YYYY-hh:mm:ss')),'mm:ss')


This way the resulting time value will be independent from the date part, e.g. using the time as dimension would only create one row per time.


Hope this helps


Regards


Marco

View solution in original post

5 Replies
PrashantSangle

Hi,

Try like

timestamp(timestamp#(purgechar(datefield,'hms'),'DD-MM-YYYY-hh:mm:ss'),'mm:ss')

or

time(timestamp#(purgechar(datefield,'hms'),'DD-MM-YYYY-hh:mm:ss'),'mm:ss')

If you required hours also then add "hh" in timestamp() and time()

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
anbu1984
Master III
Master III

=Replace(TextBetween('17-11-2014-00h:42m:21s',':','s'),'m','')

MarcoWedel

One small suggestion to your solution:

time(frac(timestamp#(purgechar(datefield,'hms'),'DD-MM-YYYY-hh:mm:ss')),'mm:ss')


This way the resulting time value will be independent from the date part, e.g. using the time as dimension would only create one row per time.


Hope this helps


Regards


Marco

Not applicable
Author

What if i want to make it as a field tht contains all the values

i tried in the edit script 'time(frac(timestamp#(purgechar(datefield,'hms'),'DD-MM-YYYY-hh:mm:ss')),'mm:ss') as Time' but the time field wont show any values.

PrashantSangle

Hi,

timestamp(timestamp#(purgechar(datefield,'hms'),'DD-MM-YYYY-hh:mm:ss'),'DD-MM-YYYY-hh:mm:ss')


Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂