Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

logging script duration with fractions

Hi! Can't get my duration log to register fractions of a second.
LET
SCRIPT_START = now(1);
table1:
LOAD
     1
as F1
AutoGenerate 10000000
;
LET LOAD_DURATION = now(1) - SCRIPT_START;
CALL Log ('Loading table1 took '& interval(LOAD_DURATION,'ss.fff'));

How to format LOAD_DURATION so I get ex. 2.344s?
1 Solution

Accepted Solutions

Re: logging script duration with fractions

Hi,

Now() will return seconds as the minimum, not fractions of seconds. So in any case two variables with two different values of Now() will store seconds, that's why fractions are not shown.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

3 Replies
MVP
MVP

Re: logging script duration with fractions

Hi Thomas,

interesting issue. If you add a small number to LOAD_DURATION like

interval(LOAD_DURATION+1e-006,'dd:hh:mm:ss,fff')

or use the small number without LOAD_DURATION, the fraction will appear, but only showing the addtional number (I tested this with an variable and text box output, I think LOG is a function defined in your script, right?).

I thought of truncation of LOAD_DURATION during interval evaluation, but my modification shouldn't work then neither.

Also printing LOAD_DURATION and sum of LOG_DURATION+1e-006 looks fine.

So I can't see a problem with the format and use of interval function, I am also clueless. This absolutely does not look logically to me.

Sorry, no real answer :-(

Stefan

Re: logging script duration with fractions

Hi,

Now() will return seconds as the minimum, not fractions of seconds. So in any case two variables with two different values of Now() will store seconds, that's why fractions are not shown.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable

logging script duration with fractions

Hi Stefan! Log is a subroutine. I'm just, trying to, extend Robs external logging from his cookbook.

Community Browser