Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

subtract minutes from timestamp

Hi,

I have a timestamp from which I have to subtract minutes.

LOAD Timestamp#(TAMPER_DUR,'mm')as TimeMinutes,

     Timestamp#(REC_DATETIME,'MM-DD-YYYY hh.mm.ss')as RecoveryDate,

     Interval#( Timestamp#(REC_DATETIME,'MM-DD-YYYY hh.mm.ss')- Timestamp#(TAMPER_DUR,'mm'),'MM-DD-YYYY hh.mm.ss') as TimeInterval_Date;

I am not getting correct answer with this.

Thanks

Asmita

1 Solution

Accepted Solutions
8 Replies
tresesco
MVP
MVP

try this:

Interval( Timestamp#(REC_DATETIME,'MM-DD-YYYY hh.mm.ss')-

Timestamp#(TAMPER_DUR,'mm'),'MM-DD-YYYY hh.mm.ss') as TimeInterval_Date;

//remove '#' from interval

Not applicable
Author

Thanks Tresesco,but its not working.

Not applicable
Author

I figured out the following script and it is working for me

LOAD REC_DATETIME,

    `TAMPER_DUR`,

    timestamp(`REC_DATETIME`-Time#(TAMPER_DUR,'mm')) as TimeInterval;

tresesco
MVP
MVP

How is the data in TAMPER_DUR? I mean format.

Not applicable
Author

It is in minutes.

Ex:   Tamper_DUR

            7

            8

tresesco
MVP
MVP

See,

=Timestamp(Today()-time#(10,'mm'))   works fine to give right answer. Can you share a small sample app?

Not applicable
Author

Data is as follows:

REC_DATETIME                   Tamper_DUR

7/15/2013 12:32:00 PM               3

7/15/2013 12:45:00 PM                7

7/15/2013 1:02:00 PM                  6 

tresesco
MVP
MVP

PFA