Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate seconds diff.

Hi All,

I Load the sample data this way and want to get difference in the seconds how can i do this in script in place of this

Interval( [Close Date Time] - [Create Date Time], 'DD' )  want to get seconds difference in script and then average.

LOAD

*,

Interval( [Close Date Time] - [Create Date Time], 'DD' )  AS DiffDays

FROM DataSource;


Now in front end just use

Sum(DiffDays)/Count(Id)


And calculate Average in bar chart this way.


Dim : Region

Expression :- Sum(DiffDays)/Count(Id)


Note:- Here my question is what is the unit of measurement of this average calculation in expression.


I attached the sample data.


Any one reply on this.


Thanks,

Bosc


2 Replies
Not applicable
Author

Use Seconds parameter like below:

Method1:

Num#(Text#(Interval([Close Date Time] - [Create Date Time] , 's')))

The above purely convert interval value into string & then Num

Method2:

( Num([Close Date Time]) - Num([Create Date Time]))*86400

Not applicable
Author

I attached the sample data file please check.

Bosc