Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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/2016 | 01 | 22:30 | 02:15 | 20 |
01/07/2016 | 04 | 05:00 | 08:00 | 17 |
01/07/2016 | 110 | 15:00 | 20:45 | 24 |
01/07/2016 | 145 | 11:15 | 14:15 | 16 |
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
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/2016 | 01 | 22:30 | 02:15 | 20 | 3.75 | 5.33 |
01/07/2016 | 04 | 05:00 | 08:00 | 17 | 3 | 5.67 |
01/07/2016 | 110 | 15:00 | 20:45 | 24 | 5.75 | 4.17 |
01/07/2016 | 145 | 11:15 | 14:15 | 16 | 3 | 5.33 |
Hi Kalyana,
you can calculated same as below:
( Running MTS / num(time(Interval([Machine Off Time]-[Machine On Time]),'mm'))) * 60
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/2016 | 01 | 22:30 | 02:15 | 20 | 3.75 | 5.33 |
01/07/2016 | 04 | 05:00 | 08:00 | 17 | 3 | 5.67 |
01/07/2016 | 110 | 15:00 | 20:45 | 24 | 5.75 | 4.17 |
01/07/2016 | 145 | 11:15 | 14:15 | 16 | 3 | 5.33 |
How duration showing more than, 60 Minutes / Seconds???