July 6, 201510 yr Ok, back when I first started my table the standard calculation of end/start worked fine as a repeating value. now that i want to use this time showing function from another "solution" I can't get it to output correctly. it will only show the last repetition i entered and won't repeat to the other values. i know there is a simple solution, but i am at a loss. Let ( [ $end = GetRepetition ( END ; Get ( ActiveRepetitionNumber ) ) ; $start = GetRepetition ( Start ; Get ( ActiveRepetitionNumber)) ] ; Round(Hour( $END -$Start ) + Minute( $END - $Start) / 60 - BREAKS;2)+If(GetAsNumber($END) < GetAsNumber($Start);24;0))
July 6, 201510 yr I don't think it's possible to understand your question. Instead of posting a calculation that doesn't do what you want, you should start with what you have (which fields will the calculation use as its input, what are their types, and what do they represent) and then explain what do you want to actually calculate. If I dare to venture a guess: supposing you have two repeating Time fields named Start and End, then a calculation field, with its result type set to Time, and the number of repetitions to (at least) the same number of repetitions as the two input fields = End - Start will return - in each repetition - the duration calculated using the start and end times in the corresponding repetitions of the input fields. it would be probably better to use individual records in a related table instead of the repeating fields.
July 6, 201510 yr Let ( [ $end = GetRepetition ( END ; Get ( ActiveRepetitionNumber ) ) ; $start = GetRepetition ( Start ; Get ( ActiveRepetitionNumber)) ] ; Round(Hour( $END -$Start ) + Minute( $END - $Start) / 60 - BREAKS;2)+If(GetAsNumber($END) < GetAsNumber($Start);24;0)) This calculation is very hard to read. May I suggest for future posts that you add a bit of formatting to your calculations? E.g. Let ( [ $end = GetRepetition ( END ; Get ( ActiveRepetitionNumber ) ) ; $start = GetRepetition ( Start ; Get ( ActiveRepetitionNumber ) ) ] ; Round ( Hour ( $END - $Start ) + Minute ( $END - $Start ) / 60 - BREAKS ; 2 ) + If ( GetAsNumber($END) < GetAsNumber($Start) ; 24 )) Now at least it is is (better) readable, and problematic areas can be spotted more easily. PS: You shouldn't declare $vars in Let(), unless you know what you're doing.
July 7, 201510 yr Author When it was just the straight Time /end calculations, the fields worked. When i try to use the rounding formula all hell broke loose. if i changed the /let code to a function, would it go back to operating the way i wanted? ( i had it originally as if end < start; 24+End-start;end-start (With hour (start) (hour(end) being used. It worked as I intended. - but then it wouldn't show the partial times. As for the variables I didn't want to create another cell to do the calculations i needed.
July 7, 201510 yr if i changed the /let code to a function, would it go back to operating the way i wanted? Who knows? (Actually, the question makes no sense whatsoever. Let() is already a function.) you should start with what you have (which fields will the calculation use as its input, what are their types, and what do they represent) and then explain what do you want to actually calculate. Edited July 7, 201510 yr by comment
July 7, 201510 yr Author Apparently, there was alot of field errors. I deleted the variables, and the rounding and it now works perfectly.
Create an account or sign in to comment