Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Timestamp interval problem

I'm trying to use the Interval function to get the difference in minutes between two timestamps, but the result is in error.  Here's the function I'm using in my load script:

Interval(TimeStamp#(TimeStamp(EndLoadTimestamp, 'M/D/YYYY h:mm:ss'), 'M/D/YYYY h:mm:ss') - TimeStamp#(TimeStamp(BeginLoadTimestamp, 'M/D/YYYY h:mm:ss'), 'M/D/YYYY h:mm:ss'), 'm') as MinutesToLoad

Here's what the results look like:

    

Month(Date)OrderTypeSalesOrderBeginLoadTimestampEndLoadTimestampMinutesToLoad
MaySO211694435/30/2018 8:55:375/30/2018 8:58:120.00
MaySO211694145/30/2018 7:33:365/30/2018 7:33:370.00
MaySO211693445/30/2018 2:18:395/30/2018 2:19:260.00
MaySO211693425/29/2018 18:11:435/29/2018 18:11:560.00
MaySO211691915/29/2018 12:07:495/29/2018 12:08:140.00
MaySO211691755/29/2018 18:42:195/29/2018 18:42:190.00
MaySO211691395/29/2018 16:08:045/29/2018 16:58:590.04
MaySO211691235/29/2018 18:34:415/29/2018 21:38:010.13

Any ideas on how to get this work correctly?

Thanks.

1 Solution

Accepted Solutions
Highlighted

Try this

Interval(TimeStamp#(EndLoadTimestamp, 'M/D/YYYY h:mm:ss') - TimeStamp#(BeginLoadTimestamp, 'M/D/YYYY h:mm:ss'), 'm') as MinutesToLoad

View solution in original post

14 Replies
Highlighted

Try this

Interval(TimeStamp#(EndLoadTimestamp, 'M/D/YYYY h:mm:ss') - TimeStamp#(BeginLoadTimestamp, 'M/D/YYYY h:mm:ss'), 'm') as MinutesToLoad

View solution in original post

Highlighted
Creator III
Creator III

Worked great.  Thanks!

Highlighted
Partner
Partner

Do you know how this can be done as an IF Statement, I basically need to convert the times in Minutes to particular phrases. I've tried.....

=If(Interval(TimeStamp#([End Time]) - TimeStamp#([Start Time]), 'm') = '90','Basic')

So I want any appointments that are 90 mins long to show as Basic.

The (Interval(TimeStamp#([End Time]) - TimeStamp#([Start Time]), 'm') formula works correctly and shows the length of each appointment in Min's but the if statement is blank.

Highlighted

May be try this

=If(Interval(TimeStamp#([End Time]) - TimeStamp#([Start Time]), 'm') = MakeTime(1, 30), 'Basic')

Highlighted
Partner
Partner

That works great, thank you!

Highlighted
Partner
Partner

I cant seem to get this to work with any other time lengths?

I.e. I though 30 mins would be (0,30) or (30)

And 2 hours would be (2,00)

Highlighted

It is... 30 Minutes = MakeTime(0, 30) and 2 hours is MakeTime(2)

Highlighted
Partner
Partner

Both return blanks :/. Am I missing something here.

Highlighted

I have no idea... may be share a sample