Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time Difference between timestamps

Hi,

Does anyone knows how to get the difference in Time between two TimeStamp vars?

Ex:

LET vSTART = NOW();

... Process

LET vEND = NOW();

LET vTime = ?

TRACE >>> Executed in: $(vTime);

Thanks in advance

1 Solution

Accepted Solutions
maxgro
MVP
MVP

LET vSTART = NOW();

LOAD

rand()

AutoGenerate 10000000;

LET vEND = NOW();

LET vTime = interval(vEND  - vSTART, 'hh:mm:ss');

TRACE >>> Executed in: $(vTime);

LOg:

AUTOGENERATE(10000000) 10.000.000 lines fetched

>>> Executed in: 00:00:10

View solution in original post

4 Replies
Not applicable
Author

Does Anyone Know it?

I am stuck on it

Thanks

maxgro
MVP
MVP

LET vSTART = NOW();

LOAD

rand()

AutoGenerate 10000000;

LET vEND = NOW();

LET vTime = interval(vEND  - vSTART, 'hh:mm:ss');

TRACE >>> Executed in: $(vTime);

LOg:

AUTOGENERATE(10000000) 10.000.000 lines fetched

>>> Executed in: 00:00:10

Not applicable
Author

Thank you so much Massimo!

Works perfectly!

MK_QSL
MVP
MVP

At the start of the script i.e. after system variable...

TYPE

let vLastLoadStart = now();

and

at the end of the all script...

TYPE

let vLastLoadEnd = now();

Now you can get Load Time Duration difference by

date(vLastLoadEnd - vLastLoadStart, 'hh:mm:ss')