Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

How To Convert Time into Mins?

Hi,

- I have a field wtih Date and time in my script.

- Now i want to convert the time into minutes and should stored in variable.

- I tried the following script in the text box. It is working perfecty and display in the text box.

=interval(frac(timestamp#('04-24-2011 11:24:56', 'MM-DD-YYYY h:mm:ss')),'mm')

But it is not working when i taken the field of particular time(i.e DateTime)

=interval(frac(timestamp#(DateTime, 'MM-DD-YYYY h:mm:ss')),'mm')

Plz help me...

3 Replies
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

Date and time values are stored as the number of days since 30/12/1899 + fraction of a day. So, if the fraction is .5, that would equal 12 noon.

If you subtract Date - Floor(Date), you will get that fraction and then you can multiply by (24*60) to get the number of minutes.

Regards,

Stephen

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi Stephen,

I didn't get you what your are saying can you explain briefly........

Not applicable

Hi

Have a look at the attached application.

Logic in the attached application is what Stephen Redmond talking about.

- Sridhar