Feb 28, 2018 08:47 AM
Hi, I’m having trouble building a formula trying to get a Number-per-hour output. I want to be able to input X number of things (Integer field type) and Y minutes elapsed (Time field type), and have fields for both of these. Then I want to output Z, where Z is (( X / Y ) * 60) to extrapolate X-per-hour rate. I’ve tried extracting the integer value from the Time field, or casting it as the ‘m’ (minute) Datetime_Format, but none of these seem to return properly.
Feb 28, 2018 10:34 AM
Define {Y_Minutes}
as a Duration field, formatted to display h:mm
.
Define {X_Things}
as a Number field, formatted as an integer.
Define {Z_ThingsPerHour}
as a Formula field with the following formula:
{X_Things}/(({Y_Minutes}/60)/60)
(The first division by 60 — {Y_Minutes}/60
— is to make {Y_Minutes}
calculate as minutes, as Duration fields return their values in seconds and fractional seconds. The second division by 60 is so the formula ultimately returns a value in per-hour terms. Now that you understand how we got here, feel free to change the formula to read {X_Things}/({Y_Minutes}/3600)
.)
Mar 06, 2018 12:08 PM
That worked perfectly. Thank you so much!!