Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Waiting Time

Screen Shot 2015-10-19 at 20.46.30.png

Screen Shot 2015-10-19 at 21.01.10.png

The above straight tables show time between two consecutive transaction (TimeDispensed) with a unique id ScriptNumber.  The difference between the tables is the DateDispensed and Month-Year Dispensed.  I tried calculating the wait time (TRx Wait Time), time between two consecutive transactions, with the following expression:

   =(Interval(([TimeDispensed])  -  Below([TimeDispensed])),'mm : ss')

but this gives blanks as the above table shows.  How can i resolve this and then calculate the monthly average "TRx Wait Time" and graph the average monthly wait time against Month-Year?


Regards.

1 Solution

Accepted Solutions
prabhu0505
Specialist
Specialist

To accommodate AM/PM, use below format-code.

=Interval((Time#('8:10:20 AM', 'hh:mm:ss tt') - Time#('9:00:10 AM', 'hh:mm:ss tt')),'hh:mm:ss')

View solution in original post

8 Replies
prabhu0505
Specialist
Specialist

Try something like this.

=Interval((Time#('8:10:20', 'hh:mm:ss') - Time#('9:00:10', 'hh:mm:ss')),'hh:mm:ss')

=Interval((Time#([TimeDispensed], 'hh:mm:ss') - Time#(Below([TimeDispensed])), 'hh:mm:ss')),'hh:mm:ss')

Anonymous
Not applicable
Author

try this expression

=Interval(([TimeDispensed]) -  below([TimeDispensed]),'mm : ss') 

it works for me, your expreion also showed "-"

the difference is that i use additional brackets around ([TimeDispensed]) -  below([TimeDispensed]))

Anonymous
Not applicable
Author

Many thanks, tried but gave me an expression error

Anonymous
Not applicable
Author

Many thanks, this seems not to be working for me.

prabhu0505
Specialist
Specialist

share the application, if possible.

Anonymous
Not applicable
Author

i used an inline table without "AM"

now I changed it. my inline  table is

TEST:
Load * Inline [
TimeDispensed
8:00:00 AM
8:10:00 AM
]
;

Expression in straight table is:

=Interval((time((time#([TimeDispensed],'h:mm:ss TT'))) -  below(time(time#([TimeDispensed],'h:mm:ss TT')))),'mm : ss') 

table Looks like (value is negative as Expression subtract 8:10 from 8:00!

prabhu0505
Specialist
Specialist

To accommodate AM/PM, use below format-code.

=Interval((Time#('8:10:20 AM', 'hh:mm:ss tt') - Time#('9:00:10 AM', 'hh:mm:ss tt')),'hh:mm:ss')

Anonymous
Not applicable
Author

Thank you Saravana