Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
alexis
Partner - Specialist
Partner - Specialist

Deducting minutes from date/time

Hi,

I have the following function in my code which rounds the datetime field that I read to the nearest quarter:

TimeStamp(Round(interval, (1/(24*4))), 'D/M/YY HH:mm') As UsageEnd,

so 11:44:01 AM become 11:45 etc..

I want to create another field ("QuarterStart") that will store a value that is 15 minutes EARLIER than the calculated value above.

Any ideas?

Thanx in advance

Alexis

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use the floor function to round down to the quarter and use the ceil function to round up to the quarter.

timestamp(floor(interval, 1/96),'D/M/YY HH:mm')

timestamp(ceil(interval, 1/96),'D/M/YY HH:mm')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Use the floor function to round down to the quarter and use the ceil function to round up to the quarter.

timestamp(floor(interval, 1/96),'D/M/YY HH:mm')

timestamp(ceil(interval, 1/96),'D/M/YY HH:mm')


talk is cheap, supply exceeds demand
alexis
Partner - Specialist
Partner - Specialist
Author

Thank you Gysbert - that answers my question perfectly.

Alexis