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: 
nikhilgarg
Specialist II
Specialist II

Prob regarding Script

Hey,

I want to see the session length which is a column in session log file. I used following statement but it gives me no value under the column.

Num(Interval#(SessionDuration, 'hh:mm:ss')*24, '#,##0') as SessionLength

Also can anyone tell me what is this interval#() return if my Session Duration is : 13:21:45

Also why we need to multiply by 24?(Script is already created , not created by me so i have no idea why 24 is used)

Thanks

9 Replies
Gysbert_Wassenaar

I don't think multiplying by 24 is necessary as long as you understand that the value that the interval# function returns has days as unit. So 13:21:45 would become 0.556770833333, i.e. a bit more than half a day.


talk is cheap, supply exceeds demand
nikhilgarg
Specialist II
Specialist II
Author

Ohk so you mean interval#() returns the duration in comparison with day i.e whether half day or more or less.

Anonymous
Not applicable

Hi Nikhil,

From Help:

Interval#

interval#(expression [ , format-code ])

The interval# function evaluates the expression as a time interval according to the string given as a format-code. If the format code is omitted, the time format set in the operating system is used.

The interval# function generally behaves just like the time# function but while times can never be greater than 23:59:59 (numeric value 0.99999) or smaller than 00:00:00 (numeric value 0.00000) an interval may have any value.

Examples:

The examples below assume the following operating system settings:

Short date format:

YY-MM-DD

Time format:

hh:mm:ss

Number decimal separator:

.

interval#( A, 'D hh:mm' ) where A=1 09:00 returns:

String

1 09:00

Number

1.375

interval#( A-B ) where A=97-08-06 09:00:00 and B=97-08-05 00:00:00 returns:

String

1.375

Number

1.375

Regards

Neetha

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Yeah i ahve gone thru that but was not clear about it initially. But now i am clear almost. it works in multiples of base, ryt?? And also does offset decreases the offset value from resultant value??

jonathandienst
Partner - Champion III
Partner - Champion III

Multiplying by 24 will convert the value to hours

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Gysbert_Wassenaar

That I know. I just think that it's unnecessary.


talk is cheap, supply exceeds demand
nikhilgarg
Specialist II
Specialist II
Author

Thanks dienst

Anonymous
Not applicable

Yes,it works in multiples of base,Multiplying by 24 will Show output in hours.

'And also does offset decreases the offset value from resultant value??' - there is no offset parameter in expression:

interval#(expression [ , format-code ])

Regards

Neetha

nikhilgarg
Specialist II
Specialist II
Author

Yeh, Actually mistakenly i paste this in this section instead of Floor question post