Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
diego_rojas
Partner
Partner

Issue with timestamp field

Hi all, I'm facing this issue:

I have a timestamp field of type 2019-01-01 23:59:59.997 and I need to extract the time from this field but when I try with Timestamp#(MyField, 'YYYY-MM-DD hh:mm:ss.fff') for convert MyField in a number, the result is the same field 2019-01-01 23:59:59.997.

Does anybody knows why is this happening? And how can I solve this issue or if there is other way to extract the time (hh:mm) from this field.

 

Thanks

 

1 Solution

Accepted Solutions
sunny_talwar

Then give this a shot

Time(Frac(Timestamp#(MyField, 'YYYY-MM-DD hh:mm:ss.fff')), 'hh:mm') as Time

View solution in original post

6 Replies
sunny_talwar

Try this

Time(Frac(MyField), 'hh:mm') as Time
Vegar
Partner
Partner

The use of Timestamp#() does not change the displayed format of your field, but if you will get an underlying numeric value that represent that timestamp. When you have this numeric value then you can apply a variety of date and time manipulations to is such as @sunny_talwar solution above.
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
diego_rojas
Partner
Partner
Author

I tried but the field appear as null, I checked the type of MyField and it is tagged as $numeric $timestamp $ascii $text
sunny_talwar

Then give this a shot

Time(Frac(Timestamp#(MyField, 'YYYY-MM-DD hh:mm:ss.fff')), 'hh:mm') as Time

View solution in original post

diego_rojas
Partner
Partner
Author

Yes I thought to transform field into a number and find the time with the decimal part but it didn't work
diego_rojas
Partner
Partner
Author

Thank you, that's the answer 😄