Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
This expression currently returns a timestamp. However, I am trying to convert the following script expression in to total number of minutes so I can then divide this by a number of moves as a productivity measure.
IF(operator_name = PREVIOUS(operator_name) AND type_description = 'UNAV' AND PREVIOUS(type_description) <> 'UNAV' and che_name = previous(che_name)
or operator_name = PREVIOUS(operator_name) AND type_description = 'LGOF' AND PREVIOUS(type_description) <> 'UNAV' and che_name = previous(che_name)
or operator_name = PREVIOUS(operator_name) AND type_description = 'LGON' AND PREVIOUS(type_description) = 'AVAL' and che_name = previous(che_name),
interval(timestamp - PREVIOUS(timestamp)),'hh:mm')&' '& date(date#(left(date(Floor([timestamp])),40),'DD/MM/YYYY')), timestamp(timestamp) AS Loggedin
However, I am drawing a blank and would really appreciate some help.
Regards
Derek
Assuming the field "timestamp" is a proper Qlik datetime -- it appears it is from your example.
timestamp - Previous(timestamp)
returns the difference as integer number of days and fractional part of a day. You have two choices to convert this to minutes.
(timestamp - Previous(timestamp))* 1440. // Multiply by #minutes in a day
or
Num#(Interval(timestamp - Previous(timestamp), 'm')) // Get Interval minutes and convert the text to number
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com