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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kalyandg
Partner - Creator III
Partner - Creator III

Calculate Output Qty Per Hour

Dear All,

My requirement is to calculate Output qty per Hour.

I am having table like

Date Lot Machine On Time Machine Off Time Running MTS
01/07/20160122:3002:1520
01/07/20160405:0008:0017
01/07/201611015:0020:4524
01/07/201614511:1514:1516

I have calculated the Duration by this expression - =time(Interval([Machine Off Time]-[Machine On Time]),'hh:mm')

Running MTS is the Quantity field, for ex. Lot 01 takes 03:45 hours to produce 20 Metric Tonnes.

I have to calculate Output Quantity per Hour

Formula -  Running MTS / Duration (expression)

Please help me to get solved this.

Thanks in Advance,

Kalyan

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Kalyana,

Try adding this line in script to calculate the duration in hours. You can do this in the front end too but it's neater in the script:

Load *,

24*if([Machine Off Time] >= [Machine On Time],

[Machine Off Time] - [Machine On Time],

1+[Machine Off Time] - [Machine On Time]) as Duration;

then we can get this straight table:

Date Lot Machine On Time Machine Off Time Running MTS Duration sum([Running MTS])/sum(Duration)
4.97
01/07/20160122:3002:15203.755.33
01/07/20160405:0008:001735.67
01/07/201611015:0020:45245.754.17
01/07/201614511:1514:151635.33

View solution in original post

3 Replies
Not applicable

Hi Kalyana,

you can calculated same as below:

( Running MTS / num(time(Interval([Machine Off Time]-[Machine On Time]),'mm'))) * 60

effinty2112
Master
Master

Hi Kalyana,

Try adding this line in script to calculate the duration in hours. You can do this in the front end too but it's neater in the script:

Load *,

24*if([Machine Off Time] >= [Machine On Time],

[Machine Off Time] - [Machine On Time],

1+[Machine Off Time] - [Machine On Time]) as Duration;

then we can get this straight table:

Date Lot Machine On Time Machine Off Time Running MTS Duration sum([Running MTS])/sum(Duration)
4.97
01/07/20160122:3002:15203.755.33
01/07/20160405:0008:001735.67
01/07/201611015:0020:45245.754.17
01/07/201614511:1514:151635.33
Anil_Babu_Samineni

How duration showing more than, 60 Minutes / Seconds???

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful