Hi I am looking to set the Initial Value of a duration column called [Time Allotted]. The initial value formula would be based on the number of people selected in the [Resource] column. 1 person selected, [Time Allotted]= 2 hours, 2 people selected, [Time Allotted]=1 hour, 3 people selected, [Time Allotted] 30 mins etcβ¦
120/2^number of people-1? (halves for every person added)
If you are looking the count of people this COUNT([Resource]) should work so long as resource is itself a list. If Resource is some other column type might need a bit of a different formula.
Turns out I was not provided with all information. It seems you are correct with your observation. The [Time Alloted] starting point is actually 8 Hours for 1 person to process 100 products. 2 people 4 hours, 3 people 2.66 hours etcβ¦
What I need to do first is work out the total [Time Alloted] based on the [Quantity] of products e.g. if I have a quantity of 150 the first part of my formula, I think, needs to be 150/100 * 8 to get the total [Time Alloted] for 1 person. I then need to divide that number by the COUNT() of the [Resource] list to get the actual [Time Alloted] for this piece of work.
Iβm still thinking on if there is some smart way to do this better. But I can at least suggest for you to build the duration string up with concatenation, for now. Start by calculating time allotted in minutes.
time allotted minutes =
([Quantity]/100 * 8 * 60) / COUNT( [Resource] )
Then build the duration string for [Time Allotted]
The duration value is throwing a validation error in a scenario where [Quantity] = 50 and I add 2 [Resource]s from the EnumList. Image shows how the format of the initial value in this instance.
The minutes section needs to have 2 digits, so β2:00:00β. You probably need to add some logic into the expression to handle this and add an extrA β0β when the minutes value is less than 10.